Commit 411cc48a authored by Jérome Perrin's avatar Jérome Perrin

testnode: clean up trailing spaces

parent 97af85f9
Pipeline #21463 passed with stage
in 0 seconds
......@@ -116,7 +116,7 @@ class SlapOSControler(object):
reference : instance title
software_url : software path/url
software_type : scalability
software_configuration : dict { "_" : "{'toto' : 'titi'}" }
software_configuration : dict { "_" : "{'toto' : 'titi'}" }
Ex :
my_controler._request('Instance16h34Ben',
......@@ -170,22 +170,22 @@ class SlapOSControler(object):
self.instance_config[reference]['software_configuration'],
self.instance_config[reference]['computer_guid'],
state=state
)
)
def destroyInstance(self, reference):
logger.debug('SlapOSControler : delete instance')
try:
self._requestSpecificState(reference, 'destroyed')
except Exception:
raise ValueError("Can't delete instance %r (instance not created?)" % reference)
def stopInstance(self, reference):
logger.debug('SlapOSControler : stop instance')
try:
self._requestSpecificState(reference, 'stopped')
except Exception:
raise ValueError("Can't stop instance %r (instance not created?)" % reference)
def startInstance(self, reference):
logger.debug('SlapOSControler : start instance')
try:
......@@ -242,7 +242,7 @@ class SlapOSControler(object):
slapproxy_log_fp = open(slapproxy_log, 'w')
kwargs['stdout'] = slapproxy_log_fp
kwargs['stderr'] = slapproxy_log_fp
proxy = subprocess.Popen([config['slapos_binary'],
proxy = subprocess.Popen([config['slapos_binary'],
'proxy', 'start', '--cfg' , self.slapos_config], **kwargs)
process_manager.process_pid_set.add(proxy.pid)
......@@ -338,7 +338,7 @@ class SlapOSControler(object):
# so be tolerant and run it a few times before giving up
for _ in range(MAX_SR_RETRIES):
status_dict = self.spawn(config['slapos_binary'],
'node', 'software', '--all',
'node', 'software', '--all',
'--pidfile', os.path.join(self.software_root, 'slapos-node.pid'),
'--cfg', self.slapos_config, raise_error_if_fail=False,
log_prefix='slapgrid_sr', get_output=False)
......@@ -361,11 +361,11 @@ class SlapOSControler(object):
logger.exception("SlapOSControler.runComputerPartition")
raise ValueError("Unable to registerOpenOrder")
# try to run for all partitions as one partition may in theory request another one
# try to run for all partitions as one partition may in theory request another one
# this not always is required but currently no way to know how "tree" of partitions
# may "expand"
for _ in range(max_quantity):
status_dict = self.spawn(config['slapos_binary'], 'node', 'instance',
status_dict = self.spawn(config['slapos_binary'], 'node', 'instance',
'--pidfile', os.path.join(self.instance_root, 'slapos-node.pid'),
'--cfg', self.slapos_config, raise_error_if_fail=False,
log_prefix='slapgrid_cp', get_output=False)
......@@ -377,4 +377,4 @@ class SlapOSControler(object):
# codes, but depending on slapos versions, we have inconsistent status
if status_dict['status_code'] in (1,2):
status_dict['status_code'] = 0
return status_dict
\ No newline at end of file
return status_dict
......@@ -81,7 +81,7 @@ class SlapOSMasterCommunicator(object):
except AttributeError as e:
logger.warning('Error on get software release: %s ', e.message)
self.url = url
self.url = url
#########################################################
# Wrapper functions to support network retries
......@@ -98,7 +98,7 @@ class SlapOSMasterCommunicator(object):
@retryOnNetworkFailure
def _request(self, state, instance_title=None, request_kw=None, shared=False, software_type="RootSoftwareInstance"):
if instance_title is not None:
self.name = instance_title
self.name = instance_title
if request_kw is not None:
if isinstance(request_kw, bytes):
self.request_kw = json.loads(request_kw.decode('utf-8'))
......@@ -386,7 +386,7 @@ class SlapOSTester(SlapOSMasterCommunicator):
logger.info("balancer ipv6 url not generated yet for instance: " + instance["title"])
pass
# get generated by Nexedi's CDN frontend address
# get generated by Nexedi's CDN frontend address
if "frontend-" in instance["title"]:
try:
frontend = [instance["title"].replace("frontend-", ""),
......@@ -504,7 +504,7 @@ class SoftwareReleaseTester(SlapOSTester):
for prop in entry:
if prop != "information":
message += "%s = %s\n" % (prop, json.dumps(entry[prop], indent=2))
message += "=== connection_dict === \n%s\n" % (
json.dumps(entry["information"]["connection_dict"], indent=2))
message += "\n"
......@@ -513,7 +513,7 @@ class SoftwareReleaseTester(SlapOSTester):
message += "\n"
message += "="*79
message += "\n\n\n"
return summary + message
@retryOnNetworkFailure
......
......@@ -209,4 +209,4 @@ class UnitTestRunner(object):
Used by the method testnode.constructProfile() to know
if the software.cfg have to use relative path or not.
"""
return False
\ No newline at end of file
return False
......@@ -90,7 +90,7 @@ class Updater(object):
cwd = kw.pop("cwd", None)
if cwd is None:
cwd = self.getRepositoryPath()
return self.process_manager.spawn(*args,
return self.process_manager.spawn(*args,
log_prefix='git',
cwd=cwd,
**kw)
......
......@@ -75,7 +75,7 @@ class TestNode(object):
rmtree(fpath)
else:
os.remove(fpath)
def getNodeTestSuite(self, reference):
try:
node_test_suite = self.node_test_suite_dict[reference]
......@@ -436,4 +436,4 @@ shared = true
# Exceptions are swallowed during cleanup phase
logger.info("GENERAL EXCEPTION, QUITING")
self.cleanUp()
logger.info("GENERAL EXCEPTION, QUITING, cleanup finished")
\ No newline at end of file
logger.info("GENERAL EXCEPTION, QUITING, cleanup finished")
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