def __VersionIsSupported(desiredVersion, serviceVersionDescription):
 root = serviceVersionDescription
 if (root.tag == 'namespaces'):
  if (root.get('version') != '1.0'):
   raise RuntimeError(('vimServiceVersions.xml has version %s, which is not understood' % root.get('version')))
  desiredVersionId = versionIdMap[desiredVersion]
  supportedVersion = None
  for namespace in root.findall('namespace'):
   versionId = namespace.findtext('version')
   if (versionId == desiredVersionId):
    return True
   else:
    for versionId in namespace.findall('priorVersions/version'):
     if (versionId.text == desiredVersionId):
      return True
 else:
  wsdlNS = 'http://schemas.xmlsoap.org/wsdl/'
  importElement = serviceVersionDescription.find(('.//{%s}import' % wsdlNS))
  supportedVersion = versionMap[importElement.get('namespace')[4:]]
  if IsChildVersion(supportedVersion, desiredVersion):
   return True
 return False

def __VersionIsSupported ( desiredVersion , serviceVersionDescription ) : root = serviceVersionDescription if ( root . tag == 'namespaces' ) : if ( root . get ( 'version' ) != '1.0' ) : raise RuntimeError ( ( 'vimServiceVersions.xml has version %s, which is not understood' % root . get ( 'version' ) ) ) desiredVersionId = versionIdMap [ desiredVersion ] supportedVersion = None for namespace in root . findall ( 'namespace' ) : versionId = namespace . findtext ( 'version' ) if ( versionId == desiredVersionId ) : return True else : for versionId in namespace . findall ( 'priorVersions/version' ) : if ( versionId . text == desiredVersionId ) : return True else : wsdlNS = 'http://schemas.xmlsoap.org/wsdl/' importElement = serviceVersionDescription . find ( ( './/{%s}import' % wsdlNS ) ) supportedVersion = versionMap [ importElement . get ( 'namespace' ) [ 4 : ] ] if IsChildVersion ( supportedVersion , desiredVersion ) : return True return False
private method that returns true if the service version description document indicates that the desired version is supported .