Skip to content

Commit

Permalink
correct / improve comment on root_disk function rockstor#1116
Browse files Browse the repository at this point in the history
added logging to prove return value
  • Loading branch information
phillxnet committed Jan 31, 2016
1 parent aea3525 commit 1dabe4f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rockstor/fs/btrfs.py
Expand Up @@ -757,7 +757,11 @@ def btrfs_importable(disk):

def root_disk():
"""
returns the partition(s) used for /. Typically it's sda.
Returns the drive device name where / mount point is found.
Works by parsing /proc/mounts. Eg if the root entry was as follows:
/dev/sdc3 / btrfs rw,noatime,ssd,space_cache,subvolid=258,subvol=/root 0 0
the returned value is sdc
The assumption is that the partition number will be a single character.
"""
with open('/proc/mounts') as fo:
for line in fo.readlines():
Expand Down Expand Up @@ -896,6 +900,7 @@ def scan_disks(min_size):
dmap['root'], ]
for d in dnames.keys():
disks.append(Disk(*dnames[d]))
logger.info('root_disk returned the value of %s ', root)
return disks


Expand Down

0 comments on commit 1dabe4f

Please sign in to comment.