Forum Discussion
Smart way to convert a PoolMemberDefinitionSequenceSequence to a IPPortDefinitionSequenceSequence
Note - i edited this post after some investigation/testing.
ok, so i'm pretty sure the problem lies with the nested list comprehension you are using to define the pmemseq.
it looks like the pmemseq is really a flat list- If it was an IPPortDefinitionSequence, shouldn't i be able to access each object using an index?
i.e. using my pool examples from above shouldn't i be able to do this:
pmemseq.item = [x.members for x in [y for y in data_list]]
pmemseq[0][0].address ?
instead i get an error:
In [316]: pmemseq[0][0].address
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
C:\Windows\system32\ in ()
IndexError: string index out of range
if i just dump out pmemseq it does contain data, but I can't seem to get to it via indices as i would expect:
In [326]: pmemseq
Out [326]:
(Common.IPPortDefinition){
address = "10.1.1.1"
port = 80
},
(Common.IPPortDefinition){
address = "10.1.1.2"
port = 80
},,
(Common.IPPortDefinition){
address = "10.1.2.10"
port = 80
},
(Common.IPPortDefinition){
address = "10.1.2.11"
port = 80
},,
}
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com