Commit 5b2307cc authored by Marco Mariani's avatar Marco Mariani

typo, spacing, style

parent 7f05bbf5
...@@ -40,13 +40,13 @@ import tempfile ...@@ -40,13 +40,13 @@ import tempfile
import time import time
# some constants # some constants
LABEL="SLAPOS" LABEL = "SLAPOS"
MINIMUM_FREE_SPACE_GB=60 MINIMUM_FREE_SPACE_GB = 60
MINIMUM_FREE_SPACE=MINIMUM_FREE_SPACE_GB * 1024 * 1024 * 1024 MINIMUM_FREE_SPACE = MINIMUM_FREE_SPACE_GB * 1024 * 1024 * 1024
SLAPOS_MARK='# Added by SlapOS\n' SLAPOS_MARK = '# Added by SlapOS\n'
def callWithCheck(args): def callWithCheck(args):
"""Calls args in subprocesses, rasies ValueError if command failed""" """Calls args in subprocesses, raises ValueError if command failed"""
if subprocess.call(args) != 0: if subprocess.call(args) != 0:
raise ValueError raise ValueError
...@@ -126,7 +126,7 @@ def prepareSlapOSPartition(mount_point): ...@@ -126,7 +126,7 @@ def prepareSlapOSPartition(mount_point):
"""Prepare SlapOS partitioning""" """Prepare SlapOS partitioning"""
new_fstab = open('/etc/fstab', 'r').readlines() new_fstab = open('/etc/fstab', 'r').readlines()
a = new_fstab.append a = new_fstab.append
d = dict(label=LABEL) d = {'label': LABEL}
a(SLAPOS_MARK) a(SLAPOS_MARK)
a('LABEL=%(label)s /mnt/%(label)s ext4 defaults,noatime 0 0\n'% a('LABEL=%(label)s /mnt/%(label)s ext4 defaults,noatime 0 0\n'%
d) d)
...@@ -175,7 +175,7 @@ def getWidestFreeSpaceList(disk_dict): ...@@ -175,7 +175,7 @@ def getWidestFreeSpaceList(disk_dict):
for l in v: for l in v:
size = int(l.split(':')[3].rstrip('B')) size = int(l.split(':')[3].rstrip('B'))
free_space_disk_dict.setdefault(size, []) free_space_disk_dict.setdefault(size, [])
free_space_disk_dict[size].append(dict(disk=disk, info=l)) free_space_disk_dict[size].append({'disk': disk, 'info': l})
if free_space_disk_dict: if free_space_disk_dict:
m = max(free_space_disk_dict) m = max(free_space_disk_dict)
if m > MINIMUM_FREE_SPACE: if m > MINIMUM_FREE_SPACE:
......
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 to comment