[fix] Parse app arguments before creating app folder and settings

This commit is contained in:
Jérôme Lebleu 2015-12-31 19:03:58 +01:00
parent a1ab3d5811
commit 6a836ae0bf

View file

@ -444,6 +444,12 @@ def app_install(auth, app, label=None, args=None):
# Change app_id to the forked app id # Change app_id to the forked app id
app_id = app_id + '__' + str(instance_number) app_id = app_id + '__' + str(instance_number)
# Retrieve arguments list for install script
args_dict = {} if not args else \
dict(urlparse.parse_qsl(args, keep_blank_values=True))
args_list = _parse_args_from_manifest(manifest, 'install', args_dict, auth)
args_list.append(app_id)
# Prepare App settings # Prepare App settings
app_setting_path = apps_setting_path +'/'+ app_id app_setting_path = apps_setting_path +'/'+ app_id
@ -471,12 +477,6 @@ def app_install(auth, app, label=None, args=None):
os.system('chown -R admin: '+ app_tmp_folder) os.system('chown -R admin: '+ app_tmp_folder)
# Retrieve arguments list for install script
args_dict = {} if not args else \
dict(urlparse.parse_qsl(args, keep_blank_values=True))
args_list = _parse_args_from_manifest(manifest, 'install', args_dict, auth)
args_list.append(app_id)
# Execute App install script # Execute App install script
os.system('chown -hR admin: %s' % install_tmp) os.system('chown -hR admin: %s' % install_tmp)
# Move scripts and manifest to the right place # Move scripts and manifest to the right place