~bbaqar/charms/trusty/neutron-api-plumgrid/temp

« 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:05:55 UTC
  • mfrom: (18.1.7 neutron-api-plumgrid)
  • Revision ID: bbaqar@plumgrid.com-20160425090555-yl82ba6bhwjqkwr9
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, "")