Commit 79850611 by Máhonfai Bálint

Set correct permissions after importing disk

Importing a qcow2 file without converting it potentially has the wrong permissions, this will cause problems when eg. saving the disk as a template. Fix it by setting the correct permissions explicitly.
parent 5bee7535
...@@ -291,6 +291,8 @@ class Disk(object): ...@@ -291,6 +291,8 @@ class Disk(object):
downloaded_file, downloaded_file,
self.get_path()] self.get_path()]
subprocess.check_output(cmdline) subprocess.check_output(cmdline)
os.chmod(self.get_path(), 0o644)
except AbortException: except AbortException:
if os.path.exists(downloaded_file): if os.path.exists(downloaded_file):
os.unlink(downloaded_file) os.unlink(downloaded_file)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment