Esempio n. 1
0
def detach_volume(driver, instance_id, volume_id, *args, **kwargs):
    try:
        detach = detach_task.si(driver.__class__, driver.provider,
                                driver.identity, instance_id, volume_id)
        # Only attempt to umount if we have sh access
        init_task = _get_umount_chain(driver, instance_id, volume_id, detach)
        print_task_chain(init_task)
        init_task.apply_async()
        return (True, None)
    except Exception as exc:
        return (False, exc.message)
def detach_volume(driver, instance_id, volume_id, *args, **kwargs):
    try:
        detach = detach_task.si(
            driver.__class__, driver.provider, driver.identity, instance_id,
            volume_id
        )
        # Only attempt to umount if we have sh access
        init_task = _get_umount_chain(driver, instance_id, volume_id, detach)
        print_task_chain(init_task)
        init_task.apply_async()
        return (True, None)
    except Exception as exc:
        return (False, exc.message)
Esempio n. 3
0
def detach_volume_task(driver, instance_id, volume_id, *args, **kwargs):
    try:
        detach_volume = detach_task.si(
            driver.__class__, driver.provider, driver.identity,
            instance_id, volume_id)
        if not hasattr(driver, 'deploy_to'):
            detach_volume.apply_async()
            return (True, None)
        #Only attempt to umount if we have sh access
        umount_chain = _get_umount_chain(driver, instance_id, volume_id, detach_volume)
        umount_chain.apply_async()
        return (True, None)
    except Exception, exc:
        return (False, exc.message)
Esempio n. 4
0
def detach_volume_task(driver, instance_id, volume_id, *args, **kwargs):
    try:
        detach_volume = detach_task.si(driver.__class__, driver.provider,
                                       driver.identity, instance_id, volume_id)
        if not hasattr(driver, 'deploy_to'):
            detach_volume.apply_async()
            return (True, None)
        # Only attempt to umount if we have sh access
        umount_chain = _get_umount_chain(driver, instance_id, volume_id,
                                         detach_volume)
        umount_chain.apply_async()
        return (True, None)
    except Exception as exc:
        return (False, exc.message)