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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
disk.py
+2
-6
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
:
# Call subprocess
try
:
try
:
return
subprocess
.
check_output
(
cmdline
)
return
subprocess
.
check_output
(
cmdline
)
except
subprocess
.
CalledProcessError
as
e
:
except
subprocess
.
CalledProcessError
as
e
:
logger
.
error
(
e
)
logger
.
error
(
e
)
raise
Exception
(
unicode
(
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