Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from stefan-walluhn/master
Browse files Browse the repository at this point in the history
fix pep8
  • Loading branch information
n3ph authored Feb 4, 2017
2 parents 5a4719c + 64e1020 commit 5cbd083
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions bootstrapvz/common/tasks/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ class MountAdditional(Task):
def run(cls, info):
import os
from bootstrapvz.base.fs.partitions.unformatted import UnformattedPartition

def is_additional(partition):
return (not isinstance(partition, UnformattedPartition) and
partition.name not in ["boot", "swap", "root"])

p_map = info.volume.partition_map
partitions = p_map.partitions
is_additional = lambda partition: (
not isinstance(partition, UnformattedPartition)
and partition.name not in ["boot", "swap", "root"]
)
name_length = lambda partition: len(partition.name)
for partition in sorted(filter(is_additional, partitions), key=name_length):
for partition in sorted(
filter(is_additional, partitions),
key=lambda partition: len(partition.name)):
partition = getattr(p_map, partition.name)
os.makedirs(os.path.join(info.root, partition.name))
if partition.mountopts is None:
Expand Down Expand Up @@ -191,6 +193,11 @@ class FStab(Task):
def run(cls, info):
import os.path
from bootstrapvz.base.fs.partitions.unformatted import UnformattedPartition

def is_additional(partition):
return (not isinstance(partition, UnformattedPartition) and
partition.name not in ["boot", "swap", "root", "type"])

p_map = info.volume.partition_map
partitions = p_map.partitions
mount_points = [{'path': '/',
Expand All @@ -211,12 +218,9 @@ def run(cls, info):
'pass_num': '0',
})

is_additional = lambda partition: (
not isinstance(partition, UnformattedPartition)
and partition.name not in ["boot", "swap", "root", "type"]
)
name_length = lambda partition: len(partition.name)
for partition in sorted(filter(is_additional, partitions), key=name_length):
for partition in sorted(
filter(is_additional, partitions),
key=lambda partition: len(partition.name)):
mount_points.append({'path': "/" + partition.name,
'partition': getattr(p_map, partition.name),
'dump': '1',
Expand Down

0 comments on commit 5cbd083

Please sign in to comment.