1
0
mirror of https://github.com/vmware/vsphere-automation-sdk-python.git synced 2024-11-26 11:19:59 -05:00

remove print statements from lookup_service_helper

This commit is contained in:
Tianhao He 2017-02-15 16:26:30 -08:00
parent 9ef07ac9c1
commit 90b109a9ac

View File

@ -48,19 +48,15 @@ class LookupServiceHelper(object):
self.client = Client(url=self.wsdl_url, location=self.soap_url) self.client = Client(url=self.wsdl_url, location=self.soap_url)
assert self.client is not None assert self.client is not None
# print(self.client)
self.client.set_options(service='LsService', port='LsPort') self.client.set_options(service='LsService', port='LsPort')
self.managedObjectReference = self.client.factory.create('ns0:ManagedObjectReference') self.managedObjectReference = self.client.factory.create('ns0:ManagedObjectReference')
self.managedObjectReference._type = 'LookupServiceInstance' self.managedObjectReference._type = 'LookupServiceInstance'
self.managedObjectReference.value = 'ServiceInstance' self.managedObjectReference.value = 'ServiceInstance'
# print(self.managedObjectReference)
lookupServiceContent = self.client.service.RetrieveServiceContent(self.managedObjectReference) lookupServiceContent = self.client.service.RetrieveServiceContent(self.managedObjectReference)
# print(lookupServiceContent)
self.serviceRegistration = lookupServiceContent.serviceRegistration self.serviceRegistration = lookupServiceContent.serviceRegistration
# print(self.serviceRegistration)
def find_sso_urls(self): def find_sso_urls(self):
""" """
@ -189,10 +185,8 @@ class LookupServiceHelper(object):
assert self.serviceRegistration is not None assert self.serviceRegistration is not None
lookupServiceRegistrationFilter = self.__create_filter_spec(product, service, endpoint, protocol) lookupServiceRegistrationFilter = self.__create_filter_spec(product, service, endpoint, protocol)
# print(lookupServiceRegistrationFilter)
result = self.client.service.List(self.serviceRegistration, lookupServiceRegistrationFilter) result = self.client.service.List(self.serviceRegistration, lookupServiceRegistrationFilter)
# print(result)
assert len(result) > 0 assert len(result) > 0
# Support for MxN # Support for MxN
# return the results in a dictionary where key is NodeId and Value is Service URL # return the results in a dictionary where key is NodeId and Value is Service URL
@ -212,10 +206,8 @@ class LookupServiceHelper(object):
assert self.serviceRegistration is not None assert self.serviceRegistration is not None
lookupServiceRegistrationFilter = self.__create_filter_spec(product, service, endpoint, protocol) lookupServiceRegistrationFilter = self.__create_filter_spec(product, service, endpoint, protocol)
# print(lookupServiceRegistrationFilter)
result = self.client.service.List(self.serviceRegistration, lookupServiceRegistrationFilter) result = self.client.service.List(self.serviceRegistration, lookupServiceRegistrationFilter)
# print(result)
assert len(result) > 0 assert len(result) > 0
urls = [] urls = []
@ -254,20 +246,16 @@ class LookupServiceHelper(object):
lookupServiceRegistrationServiceType = self.client.factory.create('ns0:LookupServiceRegistrationServiceType') lookupServiceRegistrationServiceType = self.client.factory.create('ns0:LookupServiceRegistrationServiceType')
lookupServiceRegistrationServiceType.product = 'com.vmware.cis' lookupServiceRegistrationServiceType.product = 'com.vmware.cis'
lookupServiceRegistrationServiceType.type = 'vcenterserver' lookupServiceRegistrationServiceType.type = 'vcenterserver'
# print(lookupServiceRegistrationServiceType)
lookupServiceRegistrationEndpointType = self.client.factory.create('ns0:LookupServiceRegistrationEndpointType') lookupServiceRegistrationEndpointType = self.client.factory.create('ns0:LookupServiceRegistrationEndpointType')
lookupServiceRegistrationEndpointType.type = 'com.vmware.vim' lookupServiceRegistrationEndpointType.type = 'com.vmware.vim'
lookupServiceRegistrationEndpointType.protocol = 'vmomi' lookupServiceRegistrationEndpointType.protocol = 'vmomi'
# print(lookupServiceRegistrationEndpointType)
lookupServiceRegistrationFilter = self.client.factory.create('ns0:LookupServiceRegistrationFilter') lookupServiceRegistrationFilter = self.client.factory.create('ns0:LookupServiceRegistrationFilter')
lookupServiceRegistrationFilter.serviceType = lookupServiceRegistrationServiceType lookupServiceRegistrationFilter.serviceType = lookupServiceRegistrationServiceType
lookupServiceRegistrationFilter.endpointType = lookupServiceRegistrationEndpointType lookupServiceRegistrationFilter.endpointType = lookupServiceRegistrationEndpointType
# print(lookupServiceRegistrationFilter)
result = self.client.service.List(self.serviceRegistration, lookupServiceRegistrationFilter) result = self.client.service.List(self.serviceRegistration, lookupServiceRegistrationFilter)
# print(result)
assert len(result) > 0 assert len(result) > 0
results_dict = {} results_dict = {}