Commit 85af0022 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

runner: do not retunr a bool when you are supposed to return a string

runner: realpath return a string
parent 9b8c2bf2
...@@ -142,8 +142,9 @@ def getCurrentSoftwareReleaseProfile(config): ...@@ -142,8 +142,9 @@ def getCurrentSoftwareReleaseProfile(config):
os.path.join(config['etc_dir'], ".project")).read() os.path.join(config['etc_dir'], ".project")).read()
return realpath( return realpath(
config, os.path.join(software_folder, config['software_profile'])) config, os.path.join(software_folder, config['software_profile']))
# XXXX No Comments
except: except:
return False return ''
def requestInstance(config, software_type=None): def requestInstance(config, software_type=None):
...@@ -753,7 +754,7 @@ def realpath(config, path, check_exist=True): ...@@ -753,7 +754,7 @@ def realpath(config, path, check_exist=True):
'software_link': config['software_link'] 'software_link': config['software_link']
} }
if key not in allow_list: if key not in allow_list:
return False return ''
del split_path[0] del split_path[0]
path = os.path.join(allow_list[key], *split_path) path = os.path.join(allow_list[key], *split_path)
...@@ -761,7 +762,7 @@ def realpath(config, path, check_exist=True): ...@@ -761,7 +762,7 @@ def realpath(config, path, check_exist=True):
if os.path.exists(path): if os.path.exists(path):
return path return path
else: else:
return False return ''
else: else:
return path return path
...@@ -798,7 +799,7 @@ def isSoftwareReleaseReady(config): ...@@ -798,7 +799,7 @@ def isSoftwareReleaseReady(config):
auto_deploy = config['auto_deploy'] in TRUE_VALUES auto_deploy = config['auto_deploy'] in TRUE_VALUES
auto_run = config['autorun'] in TRUE_VALUES auto_run = config['autorun'] in TRUE_VALUES
project = os.path.join(config['etc_dir'], '.project') project = os.path.join(config['etc_dir'], '.project')
if not ( os.path.exists(project) or auto_run or auto_deploy ): if not ( os.path.exists(project) and (auto_run or auto_deploy) ):
return "0" return "0"
path = open(project, 'r').readline().strip() path = open(project, 'r').readline().strip()
software_name = path software_name = path
......
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