~corey.bryant/charms/trusty/cinder/remove-missing

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/storage/linux/utils.py

  • Committer: Liam Young
  • Date: 2014-08-13 14:17:18 UTC
  • mfrom: (40.1.1 cinder)
  • Revision ID: liam.young@canonical.com-20140813141718-71vqzaf1jjfdiz9i
[gnuoy, rs=jamespage] Sync charm-helpers from lp:charm-helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    :returns: boolean: True if the path represents a mounted device, False if
47
47
        it doesn't.
48
48
    '''
 
49
    is_partition = bool(re.search(r".*[0-9]+\b", device))
49
50
    out = check_output(['mount'])
 
51
    if is_partition:
 
52
        return bool(re.search(device + r"\b", out))
50
53
    return bool(re.search(device + r"[0-9]+\b", out))