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
731fb5d5
authored
Jan 26, 2021
by
Máhonfai Bálint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix merge conflict
parent
d9aafb6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
disk.py
+14
-6
No files found.
disk.py
View file @
731fb5d5
import
json
import
shutil
import
os
import
subprocess
import
logging
...
...
@@ -287,12 +289,18 @@ class Disk(object):
meta
=
{
'percent'
:
percent
}
)
cmdline
=
[
'qemu-img'
,
'convert'
,
'-O'
,
'qcow2'
,
downloaded_file
,
self
.
get_path
()]
subprocess
.
check_output
(
cmdline
)
with
magic
.
Magic
()
as
m
:
ftype
=
m
.
id_filename
(
downloaded_file
)
if
'qcow'
in
ftype
.
lower
():
shutil
.
move
(
downloaded_file
,
self
.
get_path
())
else
:
cmdline
=
[
'qemu-img'
,
'convert'
,
'-O'
,
'qcow2'
,
downloaded_file
,
self
.
get_path
()]
subprocess
.
check_output
(
cmdline
)
except
AbortException
:
os
.
unlink
(
downloaded_file
)
if
os
.
path
.
exists
(
self
.
get_path
()):
...
...
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