This is what I ended up doing. Alternatively I could have had the WSDL locally stored and not performed the 2nd connection.
WSDLS_PRE = ['Management.Partition', 'LocalLB.Pool', 'LocalLB.NodeAddress',
'LocalLB.PoolMember']
WSDLS_V11 = ['LocalLB.Pool', 'LocalLB.NodeAddressV2', 'LocalLB.Pool',
'System.Session']
Create F5 object
print "Connecting to iControl API on LTM %s..." % ltm
try:
b = f5_build_bigip_object(ltm, user, pw, ['System.SystemInfo'],
soap_debug=SOAP_DEBUG)
except Exception, detail:
print "=== Exception Details ===\n%s\n=========================" % detail
fatals += 1
continue try next ltm in loop
else:
print "Connection successfully established."
Check API version
print "Determining iControl API version supported on LTM %s..." % ltm
try:
major, minor, patch = f5_get_api_version(b)
except Exception, detail:
print "=== Exception Details ===\n%s\n=========================" % detail
fatals += 1
continue try next ltm in loop
else:
print "API version is %d.%d.%d." % (major, minor, patch)
if major >= 11:
wsdls = WSDLS_V11
else:
wsdls = WSDLS_PRE
Callback and create f5 object using version dependent wsdls
print "Reconnecting to iControl API to request v%s specific WSDLs..." % major
try:
b = f5_build_bigip_object(ltm, user, pw, wsdls, soap_debug=SOAP_DEBUG)
except Exception, detail:
print "=== Exception Details ===\n%s\n=========================" % detail
fatals += 1
continue try next ltm in loop
else:
print "Connection successfully established."