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
78d0358b
authored
Feb 08, 2014
by
Bach Dániel
Committed by
Guba Sándor
Feb 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snapshot iso images by symlink
parent
1f9af3ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
disk.py
+12
-6
No files found.
disk.py
View file @
78d0358b
...
@@ -106,7 +106,7 @@ class Disk(object):
...
@@ -106,7 +106,7 @@ class Disk(object):
''' Creating qcow2 snapshot with base image.
''' Creating qcow2 snapshot with base image.
'''
'''
# Check if snapshot type and qcow2 format matchmatch
# Check if snapshot type and qcow2 format matchmatch
if
self
.
format
!=
'qcow2'
:
if
self
.
format
not
in
[
'qcow2'
,
'iso'
]
:
raise
Exception
(
'Invalid format:
%
s'
%
self
.
format
)
raise
Exception
(
'Invalid format:
%
s'
%
self
.
format
)
if
self
.
type
!=
'snapshot'
:
if
self
.
type
!=
'snapshot'
:
raise
Exception
(
'Invalid type:
%
s'
%
self
.
format
)
raise
Exception
(
'Invalid type:
%
s'
%
self
.
format
)
...
@@ -117,11 +117,17 @@ class Disk(object):
...
@@ -117,11 +117,17 @@ class Disk(object):
if
not
os
.
path
.
isfile
(
self
.
get_base
()):
if
not
os
.
path
.
isfile
(
self
.
get_base
()):
raise
Exception
(
'Image Base does not exists:
%
s'
%
self
.
get_base
())
raise
Exception
(
'Image Base does not exists:
%
s'
%
self
.
get_base
())
# Build list of Strings as command parameters
# Build list of Strings as command parameters
cmdline
=
[
'qemu-img'
,
if
self
.
format
==
'iso'
:
'create'
,
cmdline
=
[
'ln'
,
'-b'
,
self
.
get_base
(),
'-s'
,
'-f'
,
self
.
format
,
self
.
get_base
(),
self
.
get_path
()]
self
.
get_path
()]
else
:
cmdline
=
[
'qemu-img'
,
'create'
,
'-b'
,
self
.
get_base
(),
'-f'
,
self
.
format
,
self
.
get_path
()]
# Call subprocess
# Call subprocess
subprocess
.
check_output
(
cmdline
)
subprocess
.
check_output
(
cmdline
)
...
...
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