~plumgrid-team/charms/trusty/plumgrid-director/trunk

« back to all changes in this revision

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

  • Committer: bbaqar at plumgrid
  • Date: 2016-04-25 09:14:38 UTC
  • mfrom: (30.1.3 plumgrid-director)
  • Revision ID: bbaqar@plumgrid.com-20160425091438-4hk5s00dydf00jem
Merge: Liberty/Mitaka support

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        check_call(cmd)
77
77
 
78
78
    return create_loopback(path)
 
79
 
 
80
 
 
81
def is_mapped_loopback_device(device):
 
82
    """
 
83
    Checks if a given device name is an existing/mapped loopback device.
 
84
    :param device: str: Full path to the device (eg, /dev/loop1).
 
85
    :returns: str: Path to the backing file if is a loopback device
 
86
    empty string otherwise
 
87
    """
 
88
    return loopback_devices().get(device, "")