~openstack-charmers/charms/trusty/cinder-ceph/trunk

« back to all changes in this revision

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

  • Committer: Corey Bryant
  • Date: 2016-01-04 21:26:40 UTC
  • Revision ID: corey.bryant@canonical.com-20160104212640-kwr7aqa9obca177t
[corey.bryant,r=trivial] Sync charm-helpers.

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, "")