Commit 62dbbe7e authored by Guido Trotter's avatar Guido Trotter
Browse files

OSFromDisk: use script names from constants

Reviewed-by: iustinp
parent 8ee4dc80
...@@ -1246,7 +1246,7 @@ def OSFromDisk(name, base_dir=None): ...@@ -1246,7 +1246,7 @@ def OSFromDisk(name, base_dir=None):
% (api_versions, constants.OS_API_VERSION)) % (api_versions, constants.OS_API_VERSION))
# OS Scripts dictionary, we will populate it with the actual script names # OS Scripts dictionary, we will populate it with the actual script names
os_scripts = {'create': '', 'export': '', 'import': '', 'rename': ''} os_scripts = dict.fromkeys(constants.OS_SCRIPTS)
for script in os_scripts: for script in os_scripts:
os_scripts[script] = os.path.sep.join([os_dir, script]) os_scripts[script] = os.path.sep.join([os_dir, script])
...@@ -1267,10 +1267,10 @@ def OSFromDisk(name, base_dir=None): ...@@ -1267,10 +1267,10 @@ def OSFromDisk(name, base_dir=None):
return objects.OS(name=name, path=os_dir, status=constants.OS_VALID_STATUS, return objects.OS(name=name, path=os_dir, status=constants.OS_VALID_STATUS,
create_script=os_scripts['create'], create_script=os_scripts[constants.OS_SCRIPT_CREATE],
export_script=os_scripts['export'], export_script=os_scripts[constants.OS_SCRIPT_EXPORT],
import_script=os_scripts['import'], import_script=os_scripts[constants.OS_SCRIPT_IMPORT],
rename_script=os_scripts['rename'], rename_script=os_scripts[constants.OS_SCRIPT_RENAME],
api_versions=api_versions) api_versions=api_versions)
......
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