Commit 73448779 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

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

parent eeed319f
...@@ -352,15 +352,14 @@ def config_SR_folder(config): ...@@ -352,15 +352,14 @@ def config_SR_folder(config):
md5sum = md5digest(profile) md5sum = md5digest(profile)
link_to_folder(name, md5sum) link_to_folder(name, md5sum)
# check other links # check other links
# XXX-Marco do not shadow 'list' software_link_list = []
list = []
for path in os.listdir(config['software_link']): for path in os.listdir(config['software_link']):
cfg_path = os.path.join(config['software_link'], path, config_name) cfg_path = os.path.join(config['software_link'], path, config_name)
if os.path.exists(cfg_path): if os.path.exists(cfg_path):
cfg = open(cfg_path).read().split("#") cfg = open(cfg_path).read().split("#")
if len(cfg) != 2: if len(cfg) != 2:
continue # there is a broken config file continue # there is a broken config file
list.append(cfg[1]) software_link_list.append(cfg[1])
if os.path.exists(config['software_root']): if os.path.exists(config['software_root']):
folder_list = os.listdir(config['software_root']) folder_list = os.listdir(config['software_root'])
else: else:
...@@ -368,14 +367,14 @@ def config_SR_folder(config): ...@@ -368,14 +367,14 @@ def config_SR_folder(config):
if not folder_list: if not folder_list:
return return
for folder in folder_list: for folder in folder_list:
if folder in list: if folder in software_link_list:
continue # this folder is already registered continue # this folder is already registered
else: else:
link_to_folder(folder, folder) link_to_folder(folder, folder)
def loadSoftwareRList(config): def loadSoftwareRList(config):
"""Return list (of dict) of Software Release from symbolik SR folder""" """Return list (of dict) of Software Release from symbolik SR folder"""
list = [] sr_list = []
config_name = 'slaprunner.config' config_name = 'slaprunner.config'
for path in os.listdir(config['software_link']): for path in os.listdir(config['software_link']):
cfg_path = os.path.join(config['software_link'], path, config_name) cfg_path = os.path.join(config['software_link'], path, config_name)
...@@ -383,8 +382,8 @@ def loadSoftwareRList(config): ...@@ -383,8 +382,8 @@ def loadSoftwareRList(config):
cfg = open(cfg_path).read().split("#") cfg = open(cfg_path).read().split("#")
if len(cfg) != 2: if len(cfg) != 2:
continue # there is a broken config file continue # there is a broken config file
list.append(dict(md5=cfg[1], path=cfg[0], title=path)) sr_list.append(dict(md5=cfg[1], path=cfg[0], title=path))
return list return sr_list
def isInstanceRunning(config): def isInstanceRunning(config):
......
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