Commit cb167dee authored by Benjamin Blanc's avatar Benjamin Blanc

testnode: SlapOSMasterCommunicator: add logs

parent 98a6e3ab
...@@ -61,8 +61,11 @@ class ScalabilityTestRunner(): ...@@ -61,8 +61,11 @@ class ScalabilityTestRunner():
certificate = self.testnode.test_suite_portal.getSlaposAccountCertificate() certificate = self.testnode.test_suite_portal.getSlaposAccountCertificate()
self.slapos_controler.createSlaposConfigurationFileAccount(key,certificate, self.slapos_controler.createSlaposConfigurationFileAccount(key,certificate,
self.testnode.config) self.testnode.config)
self.slapos_communicator = SlapOSMasterCommunicator.SlapOSMasterCommunicator(key, certificate, self.slapos_communicator = SlapOSMasterCommunicator.SlapOSMasterCommunicator(
'https://rest.slapos.org/Base_getHateoasMaster') key,
certificate,
self.log,
url='https://rest.slapos.org/Base_getHateoasMaster')
self.remaining_software_installation_dict = {} self.remaining_software_installation_dict = {}
# Protection to prevent installation of softwares after checking # Protection to prevent installation of softwares after checking
......
...@@ -27,11 +27,12 @@ class SlapOSMasterCommunicator(object): ...@@ -27,11 +27,12 @@ class SlapOSMasterCommunicator(object):
print news['news'] print news['news']
""" """
def __init__(self, certificate_path, def __init__(self, certificate_path, key_path, log,
key_path,
url='https://rest.slapos.org/Base_getHateoasMaster'): url='https://rest.slapos.org/Base_getHateoasMaster'):
# Create connection # Create connection
api_scheme, api_netloc, api_path, api_query, api_fragment = urlparse.urlsplit(url) api_scheme, api_netloc, api_path, api_query, api_fragment = urlparse.urlsplit(url)
self.log = log
self.log("HTTPS Connection with: %s, cert=%s, key=%s" %(api_netloc,key_path,certificate_path))
self.connection = httplib.HTTPSConnection(api_netloc, key_file=key_path, cert_file=certificate_path) self.connection = httplib.HTTPSConnection(api_netloc, key_file=key_path, cert_file=certificate_path)
# Get master # Get master
master_link = {'href':api_path,'type':"application/vnd.slapos.org.hal+json; class=slapos.org.master"} master_link = {'href':api_path,'type':"application/vnd.slapos.org.hal+json; class=slapos.org.master"}
...@@ -46,6 +47,8 @@ class SlapOSMasterCommunicator(object): ...@@ -46,6 +47,8 @@ class SlapOSMasterCommunicator(object):
# has been visited) # has been visited)
self.hosting_subcriptions_dict = {} self.hosting_subcriptions_dict = {}
self.visited_hosting_subcriptions_link_list = [] self.visited_hosting_subcriptions_link_list = []
self.log("SlapOSMasterCommunicator will read all hosting subscriptions entries, "
"it may take several time...")
self._update_hosting_subscription_informations() self._update_hosting_subscription_informations()
def _curl(self, link): def _curl(self, link):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment