Skip to content

Commit

Permalink
simplify return value of disk partitions in scan_disks() rockstor#1494
Browse files Browse the repository at this point in the history
If we only return an empty list or a non empty list then
dependant conditionals are simplified.
  • Loading branch information
phillxnet committed Nov 12, 2016
1 parent 5063a49 commit 315556c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rockstor/system/osi.py
Expand Up @@ -223,8 +223,9 @@ def scan_disks(min_size):
# End readability variables assignment
if is_partition:
dmap['parted'] = True
# We don't account for partitions within partitions.
dmap['partitions'] = None
# We don't account for partitions within partitions, but making
# an empty list here simplifies conditionals as always a list then.
dmap['partitions'] = []
# Search our working dictionary of already scanned devices by name
# We are assuming base devices are listed first and if of interest
# we have recorded it and can now back port it's partitioned status.
Expand Down

0 comments on commit 315556c

Please sign in to comment.