Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
storagedriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
4
Wiki
Snippets
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):
disk_path
)
def
common_snapshot_operation
(
self
,
cmdline
):
# Check if file already exists
if
not
os
.
path
.
isfile
(
self
.
get_path
()):
raise
Exception
(
'Image does not exists:
%
s'
%
self
.
get_path
())
# Build list of Strings as command parameters
raise
Exception
(
'Image does not exist:
%
s'
%
self
.
get_path
())
if
self
.
format
==
'iso'
or
self
.
format
==
'raw'
:
raise
NotImplemented
()
else
:
# Call subprocess
try
:
return
subprocess
.
check_output
(
cmdline
)
except
subprocess
.
CalledProcessError
as
e
:
logger
.
error
(
e
)
raise
Exception
(
unicode
(
e
))
try
:
return
subprocess
.
check_output
(
cmdline
)
except
subprocess
.
CalledProcessError
as
e
:
logger
.
error
(
e
)
raise
Exception
(
unicode
(
e
))
def
snapshot
(
self
,
snapshot_name
):
def
create_
snapshot
(
self
,
snapshot_name
):
''' Creating qcow2 snapshot.
'''
cmdline
=
[
'qemu-img'
,
...
...
storagedriver.py
View file @
73dd2d63
...
...
@@ -60,9 +60,9 @@ def snapshot_from_base(json_data):
@celery.task
()
def
snapshot
(
disk_desc
,
snapshot_name
):
def
create_
snapshot
(
disk_desc
,
snapshot_name
):
disk
=
Disk
.
deserialize
(
disk_desc
)
disk
.
snapshot
(
snapshot_name
)
disk
.
create_
snapshot
(
snapshot_name
)
@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