Commit ccd8605a authored by Marco Mariani's avatar Marco Mariani

runner: simpler len() and if: logic, improved naming

parent e59f85be
......@@ -278,11 +278,11 @@ def config_SR_folder(config):
continue # there is a broken config file
list.append(cfg[1])
folder_list = os.listdir(config['software_root'])
if len(folder_list) < 1:
if not folder_list:
return
current_project = open(os.path.join(config['etc_dir'], ".project")).read()
projects = current_project.split('/')
name = projects[len(projects) - 2]
name = projects[-2]
for folder in folder_list:
if folder in list:
continue # this folder is already registered
......
......@@ -182,17 +182,17 @@ def editInstanceProfile():
# get status of all computer partitions and process state
@login_required()
def inspectInstance():
file_content = ''
result = ''
if os.path.exists(app.config['instance_root']):
file_content = 'instance_root'
result = getSvcStatus(app.config)
if len(result) == 0:
result = []
file_path = 'instance_root'
supervisor = getSvcStatus(app.config)
else:
file_path = ''
supervisor = []
return render_template('instanceInspect.html',
file_path=file_content, supervisor=result,
file_path=file_path,
supervisor=supervisor,
slap_status=getSlapStatus(app.config),
supervisore=result, partition_amount=app.config['partition_amount'])
partition_amount=app.config['partition_amount'])
#Reload instance process ans returns new value to ajax
......
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