Commit 73448779 by Thomas Gambier

[runner] cleanup: do not use list as a variable

1 parent eeed319f
......@@ -352,15 +352,14 @@ def config_SR_folder(config):
md5sum = md5digest(profile)
link_to_folder(name, md5sum)
# check other links
# XXX-Marco do not shadow 'list'
list = []
software_link_list = []
for path in os.listdir(config['software_link']):
cfg_path = os.path.join(config['software_link'], path, config_name)
if os.path.exists(cfg_path):
cfg = open(cfg_path).read().split("#")
if len(cfg) != 2:
continue # there is a broken config file
list.append(cfg[1])
software_link_list.append(cfg[1])
if os.path.exists(config['software_root']):
folder_list = os.listdir(config['software_root'])
else:
......@@ -368,14 +367,14 @@ def config_SR_folder(config):
if not folder_list:
return
for folder in folder_list:
if folder in list:
if folder in software_link_list:
continue # this folder is already registered
else:
link_to_folder(folder, folder)
def loadSoftwareRList(config):
"""Return list (of dict) of Software Release from symbolik SR folder"""
list = []
sr_list = []
config_name = 'slaprunner.config'
for path in os.listdir(config['software_link']):
cfg_path = os.path.join(config['software_link'], path, config_name)
......@@ -383,8 +382,8 @@ def loadSoftwareRList(config):
cfg = open(cfg_path).read().split("#")
if len(cfg) != 2:
continue # there is a broken config file
list.append(dict(md5=cfg[1], path=cfg[0], title=path))
return list
sr_list.append(dict(md5=cfg[1], path=cfg[0], title=path))
return sr_list
def isInstanceRunning(config):
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!