Python charmhelpers.core.host 模块,umount() 实例源码

我们从Python开源项目中,提取了以下42个代码示例,用于说明如何使用charmhelpers.core.host.umount()

项目:charm-glusterfs    作者:openstack    | 项目源码 | 文件源码
def ephemeral_unmount() -> Result:
    """
    Unmount amazon ephemeral mount points.
    :return: Result with Ok or Err depending on the outcome of unmount.
    """
    mountpoint = config("ephemeral_unmount")
    if mountpoint is None:
        return Ok(())
    # Remove the entry from the fstab if it's set
    fstab = FsTab(os.path.join(os.sep, "etc", "fstab"))
    log("Removing ephemeral mount from fstab")
    fstab.remove_entry_by_mountpoint(mountpoint)

    if filesystem_mounted(mountpoint):
        result = umount(mountpoint=mountpoint)
        if not result:
            return Err("unmount of {} failed".format(mountpoint))
        # Unmounted Ok
        log("{} unmounted".format(mountpoint))
        return Ok(())
    # Not mounted
    return Ok(())
项目:charm-swift-proxy    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-keystone    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-nova-cloud-controller    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-nova-compute    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceph-osd    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-glance    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-neutron-api    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceph-mon    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-openstack-dashboard    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceilometer    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceilometer    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceilometer    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-hacluster    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceph    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceph-radosgw    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-swift-storage    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:equlipse    作者:konono    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:equlipse    作者:konono    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:equlipse    作者:konono    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:equlipse    作者:konono    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-rabbitmq-server    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-percona-cluster    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-percona-cluster    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-cinder    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-lxd    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-nova-compute-proxy    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceilometer-agent    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-ceph-proxy    作者:openstack    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()
项目:charm-helpers    作者:juju    | 项目源码 | 文件源码
def test_umounts_a_device(self, log, check_output, fstab):
        mountpoint = '/mnt/guido'

        result = host.umount(mountpoint, persist=True)

        self.assertTrue(result)
        check_output.assert_called_with(['umount', mountpoint])
        fstab.remove_by_mountpoint_called_with(mountpoint)
项目:charm-helpers    作者:juju    | 项目源码 | 文件源码
def test_umounts_and_persist_device(self, log, check_output):
        mountpoint = '/mnt/guido'

        result = host.umount(mountpoint)

        self.assertTrue(result)
        check_output.assert_called_with(['umount', '/mnt/guido'])
项目:charm-helpers    作者:juju    | 项目源码 | 文件源码
def test_doesnt_umount_on_error(self, log, check_output):
        mountpoint = '/mnt/guido'

        error = subprocess.CalledProcessError(123, 'mount it', 'Oops...')
        check_output.side_effect = error

        result = host.umount(mountpoint)

        self.assertFalse(result)
        check_output.assert_called_with(['umount', '/mnt/guido'])
项目:charm-helpers    作者:juju    | 项目源码 | 文件源码
def unmount_volume(config):
    if os.path.ismount(config['mountpoint']):
        if not host.umount(config['mountpoint'], persist=True):
            raise VolumeConfigurationError()