storage.linux.util.is_device_mounted logic doesn't work for unpartitioned disks
Bug #1370053 reported by
Robert C Jennings
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
Fix Released
|
Undecided
|
Dan Watkins |
Bug Description
When passed a full disk device (e.g. /dev/sda) is_device_mounted() function checks the mount output for '/dev/sda[0-9]+'; this means it returns False if /dev/sda is mounted directly (rather than partitioned and mounted).
Related branches
lp:~oddbloke/charm-helpers/lp1370053
- Marco Ceppi: Approve
-
Diff: 28 lines (+9/-1)2 files modifiedcharmhelpers/contrib/storage/linux/utils.py (+1/-1)
tests/contrib/storage/test_linux_storage_utils.py (+8/-0)
Changed in charm-helpers: | |
assignee: | nobody → Dan Watkins (daniel-thewatkins) |
summary: |
- storage.linux.util.is_device_mounted logic is swapped for - device/partition + storage.linux.util.is_device_mounted logic doesn't work for + unpartitioned disks |
description: | updated |
Changed in charm-helpers: | |
status: | Incomplete → New |
Changed in charm-helpers: | |
status: | New → In Progress |
Changed in charm-helpers: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
Hi,
I cannot reproduce the problem described, using revno 368 I get the following:
$ python contrib. storage. linux.utils import * mounted( device= '/dev/sda1' ) mounted( device= '/dev/sda' ) mounted( device= '/dev/sdf' ) mounted( device= '/dev/sdf1' ) ssd,space_ cache) data=ordered) ssd,space_ cache)
Python 2.7.9 (default, Apr 2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from charmhelpers.
>>> is_device_
True
>>> is_device_
True
>>> is_device_
False
>>> is_device_
False
>>>
$ bzr revno
368
$ mount|grep sda
/dev/sda6 on / type btrfs (rw,relatime,
/dev/sda1 on /boot type ext4 (rw,relatime,
/dev/sda6 on /home type btrfs (rw,relatime,
$ mount|grep sdf
# empty output
I'm setting this bug as 'incomplete', but please if you're still getting this error feel free to reopen it.
Best,