~openstack-charmers-next/charms/wily/odl-controller/trunk

« back to all changes in this revision

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

  • Committer: Gerrit Code Review
  • Author(s): Jenkins
  • Date: 2016-03-18 16:10:08 UTC
  • mfrom: (21.1.1 trunk)
  • Revision ID: review@openstack.org-20160318161008-grzlrlzei667shdd
Merge "Add support for Ubuntu Xenial"

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