Commit b171f0a4 by Bálint Máhonfai

Fix indentation errors

parent 63579fd2
......@@ -299,8 +299,7 @@ class Disk(object):
finally:
os.unlink(exported_path)
def extract_iso_from_zip(self, disk_path):
def extract_iso_from_zip(self, disk_path):
with ZipFile(disk_path, 'r') as z:
isos = z.namelist()
if len(isos) != 1:
......@@ -318,8 +317,7 @@ def extract_iso_from_zip(self, disk_path):
logger.info("Extracting %s failed, keeping original.",
disk_path)
def snapshot(self):
def snapshot(self):
""" Creating qcow2 snapshot with base image.
"""
# Check if snapshot type and qcow2 format matchmatch
......@@ -345,8 +343,7 @@ def snapshot(self):
# Call subprocess
subprocess.check_output(cmdline)
def merge_disk_with_base(self, task, new_disk, parent_id=None):
def merge_disk_with_base(self, task, new_disk, parent_id=None):
proc = None
try:
cmdline = [
......@@ -398,8 +395,7 @@ def merge_disk_with_base(self, task, new_disk, parent_id=None):
os.unlink(new_disk.get_path())
raise
def merge_disk_without_base(self, task, new_disk, parent_id=None,
def merge_disk_without_base(self, task, new_disk, parent_id=None,
length=1024 * 1024):
try:
fsrc = open(self.get_path(), 'rb')
......@@ -436,8 +432,7 @@ def merge_disk_without_base(self, task, new_disk, parent_id=None,
os.unlink(new_disk.get_path())
raise
def merge(self, task, new_disk, parent_id=None):
def merge(self, task, new_disk, parent_id=None):
""" Merging a new_disk from the actual disk and its base.
"""
......@@ -455,14 +450,12 @@ def merge(self, task, new_disk, parent_id=None):
else:
self.merge_disk_without_base(task, new_disk, parent_id)
def delete(self):
def delete(self):
""" Delete file. """
if os.path.isfile(self.get_path()):
os.unlink(self.get_path())
@classmethod
def list(cls, dir):
@classmethod
def list(cls, dir):
""" List all files in <dir> directory."""
return [cls.get(dir, file) for file in os.listdir(dir)]
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