Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
storagedriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
73dd2d63
authored
Aug 30, 2016
by
Czémán Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some small fix
parent
2dbb5cd4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
disk.py
+7
-11
storagedriver.py
+2
-2
No files found.
disk.py
View file @
73dd2d63
...
@@ -285,21 +285,17 @@ class Disk(object):
...
@@ -285,21 +285,17 @@ class Disk(object):
disk_path
)
disk_path
)
def
common_snapshot_operation
(
self
,
cmdline
):
def
common_snapshot_operation
(
self
,
cmdline
):
# Check if file already exists
if
not
os
.
path
.
isfile
(
self
.
get_path
()):
if
not
os
.
path
.
isfile
(
self
.
get_path
()):
raise
Exception
(
'Image does not exists:
%
s'
%
self
.
get_path
())
raise
Exception
(
'Image does not exist:
%
s'
%
self
.
get_path
())
# Build list of Strings as command parameters
if
self
.
format
==
'iso'
or
self
.
format
==
'raw'
:
if
self
.
format
==
'iso'
or
self
.
format
==
'raw'
:
raise
NotImplemented
()
raise
NotImplemented
()
else
:
try
:
# Call subprocess
return
subprocess
.
check_output
(
cmdline
)
try
:
except
subprocess
.
CalledProcessError
as
e
:
return
subprocess
.
check_output
(
cmdline
)
logger
.
error
(
e
)
except
subprocess
.
CalledProcessError
as
e
:
raise
Exception
(
unicode
(
e
))
logger
.
error
(
e
)
raise
Exception
(
unicode
(
e
))
def
snapshot
(
self
,
snapshot_name
):
def
create_
snapshot
(
self
,
snapshot_name
):
''' Creating qcow2 snapshot.
''' Creating qcow2 snapshot.
'''
'''
cmdline
=
[
'qemu-img'
,
cmdline
=
[
'qemu-img'
,
...
...
storagedriver.py
View file @
73dd2d63
...
@@ -60,9 +60,9 @@ def snapshot_from_base(json_data):
...
@@ -60,9 +60,9 @@ def snapshot_from_base(json_data):
@celery.task
()
@celery.task
()
def
snapshot
(
disk_desc
,
snapshot_name
):
def
create_
snapshot
(
disk_desc
,
snapshot_name
):
disk
=
Disk
.
deserialize
(
disk_desc
)
disk
=
Disk
.
deserialize
(
disk_desc
)
disk
.
snapshot
(
snapshot_name
)
disk
.
create_
snapshot
(
snapshot_name
)
@celery.task
()
@celery.task
()
...
...
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