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