Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
62dbbe7e
Commit
62dbbe7e
authored
Oct 17, 2008
by
Guido Trotter
Browse files
OSFromDisk: use script names from constants
Reviewed-by: iustinp
parent
8ee4dc80
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/backend.py
View file @
62dbbe7e
...
...
@@ -1246,7 +1246,7 @@ def OSFromDisk(name, base_dir=None):
%
(
api_versions
,
constants
.
OS_API_VERSION
))
# 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
:
os_scripts
[
script
]
=
os
.
path
.
sep
.
join
([
os_dir
,
script
])
...
...
@@ -1267,10 +1267,10 @@ def OSFromDisk(name, base_dir=None):
return
objects
.
OS
(
name
=
name
,
path
=
os_dir
,
status
=
constants
.
OS_VALID_STATUS
,
create_script
=
os_scripts
[
'create'
],
export_script
=
os_scripts
[
'export'
],
import_script
=
os_scripts
[
'import'
],
rename_script
=
os_scripts
[
'rename'
],
create_script
=
os_scripts
[
constants
.
OS_SCRIPT_CREATE
],
export_script
=
os_scripts
[
constants
.
OS_SCRIPT_EXPORT
],
import_script
=
os_scripts
[
constants
.
OS_SCRIPT_IMPORT
],
rename_script
=
os_scripts
[
constants
.
OS_SCRIPT_RENAME
],
api_versions
=
api_versions
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment