Commit 3277682e authored by Benjamin Blanc's avatar Benjamin Blanc

Many change in SlapOSControler

parent 4f37b09f
......@@ -475,6 +475,18 @@ class TaskDistributor(RPCRetry):
"""
return self._retryRPC('isValidatedMaster', (test_node_title,))
def getSlaposAccountKey(self):
"""
Returns the slapos account key related to the distributor
"""
return self._retryRPC('getSlaposAccountKey')
def getSlaposAccountCertificate(self):
"""
Returns the slapos account certificate related to the distributor
"""
return self._retryRPC('getSlaposAccountCertificate')
def getFooFooFoo(self):
"""
Returns "FooFooFoo"
......
......@@ -52,6 +52,11 @@ class ScalabilityTestRunner():
self.testnode.working_directory,
self.testnode.config,
self.testnode.log)
# Create the slapos account configuration file and dir
key = self.testnode.test_suite_portal.getSlaposAccountKey()
certificate = self.testnode.test_suite_portal.getSlaposAccountCertificate()
self.slapos_controler.createSlaposConfigurationFileAccount(key,certificate)
# {'COMPX' : ['soft_path1.cfg', 'soft_path2.cfg'],
# 'COMPY' : ['soft_path1.cfg'], ... }
self.remaining_software_installation_grid = {}
......@@ -126,14 +131,6 @@ the current cluster configuration." %(node_test_suite.test_suite_title,))
configuration_list = test_configuration['configuration_list']
launcher_nodes_computer_guid = test_configuration['launcher_nodes_computer_guid']
print "launcher_nodes_computer_guid:"
print launcher_nodes_computer_guid
print "involved_nodes_computer_guid:"
print involved_nodes_computer_guid
print "configuration_list:"
print configuration_list
software_path_list = []
for software_path in software_path_list:
for computer_guid in self.involved_nodes_computer_guid:
......
......@@ -67,8 +67,24 @@ class SlapOSControler(object):
self.slapos_config = os.path.join(working_directory, 'slapos.cfg')
self.log = log
self.proxy_database = os.path.join(working_directory, 'proxy.db')
#self.configuration_path_file = self.config['configuration_path_file']
self.configuration_path_file = ""
def createSlaposConfigurationFileAccount(key, certificate):
# Create "slapos_account" directory in the "slapos_directory"
slapos_account_directory = os.path.join(self.config['slapos_directory'], "slapos_account")
SlapOSControler.createFolder(slapos_account_directory)
# Create slapos-account files
slapos_account_key_path = os.path.join(slapos_account_directory, "key")
slapos_account_certificate_path = os.path.join(slapos_account_directory, "certificate")
configuration_file_path = os.path.join(slapos_account_directory, "slapos.cfg")
configuration_file_value = "[slapos]\nmaster_url = %s\n\
[slapconsole]\ncert_file = %s\nkey_file = %s" %(
self.config['server_url'],
slapos_account_certificate_path,
slapos_account_key_path)
SlapOSControler.createFile(slapos_account_key_path, "w", key)
SlapOSControler.createFile(slapos_account_certificate_path, "w", certificate)
SlapOSControler.createFile(configuration_file_path, "w", configuration_file_value)
self.configuration_file_path = configuration_file_path
def supply(self, software_url, computer_id, remove=False):
"""
......@@ -77,6 +93,7 @@ class SlapOSControler(object):
my_controler.supply('kvm.cfg', 'COMP-726')
"""
# TODO : remove return
print "Ben:I GONNE SEARCH MY SLAPOS CONFIG FILE THERE : %s" %self.configuration_file_path
return
self.log('SlapOSControler : supply')
parser = argparse.ArgumentParser()
......
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