Forum Discussion
Micha__Iwaszko_
Aug 23, 2011Nimbostratus
Problem with LocalLB.PoolMember.get_object_status()
I wonder what's wrong with pyControl (or something else) to produce such strange objects:
import time, pycontrol.pycontrol as pc
b = pc.BIGIP('host','user','pass',fromurl = True,wsdls = 'LocalLB.Pool','LocalLB.PoolMember'])
p = b.LocalLB.Pool.get_list()
s1 = b.LocalLB.PoolMember.get_object_status(p)
s2 = b.LocalLB.PoolMember.get_object_status(p)
if s1 == s2: print "Values are equal"
if repr(s1) == repr(s2): print "Reprs are equal"
And of course, You will only see the "Reprs are equal" line. Why is that? Do the they have some messed __eq__()?
- Micha__Iwaszko_NimbostratusI've written myself a function to achieve this, but still would be nice to have some if s1 == s2 or for i in s1: if i in s2.
- L4L7_53191NimbostratusMichael: Disclaimer - I've not actually tested this yet, but I've got an idea of what may be going on. I think what you may be dealing with is that Suds/pyControl are returning specific objects, so using s1 == s2 isn't a consistent way to compare them.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects