Example #1
0
def _get_umount_chain(driver, instance_id, volume_id, detach_task=None):
    driverCls = driver.__class__
    provider = driver.provider
    identity = driver.identity
    pre_umount_status = update_volume_metadata.si(
        driverCls, provider, identity,
        volume_id, {'tmp_status': 'unmounting'})
    umount = umount_task.si(
        driver.__class__, driver.provider, driver.identity,
        instance_id, volume_id)
    post_umount_status = update_volume_metadata.si(
        driverCls, provider, identity,
        volume_id, {'tmp_status': '',
                    'mount_location': ''})

    pre_umount_status.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id, True))
    umount.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id, True))
    post_umount_status.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id, True))
    pre_umount_status.link(umount)
    umount.link(post_umount_status)
    if detach_task:
        post_umount_status.link(detach_task)
    return pre_umount_status
Example #2
0
def _get_umount_chain(driver, instance_id, volume_id, detach_task=None):
    driverCls = driver.__class__
    provider = driver.provider
    identity = driver.identity
    pre_umount_status = update_volume_metadata.si(
            driverCls, provider, identity,
            volume_id, {'tmp_status':'unmounting'})
    umount= umount_task.si(
            driver.__class__, driver.provider, driver.identity,
            instance_id, volume_id)
    post_umount_status = update_volume_metadata.si(
            driverCls, provider, identity,
            volume_id, {'tmp_status':'',
                        'mount_location':''})

    pre_umount_status.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id, True))
    umount.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id, True))
    post_umount_status.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id, True))
    pre_umount_status.link(umount)
    umount.link(post_umount_status)
    if detach_task:
        post_umount_status.link(detach_task)
    return pre_umount_status
Example #3
0
def _get_mount_chain(driver, instance_id, volume_id, device, mount_location):
    driverCls = driver.__class__
    provider = driver.provider
    identity = driver.identity

    pre_mount_status = update_volume_metadata.si(driverCls, provider, identity,
                                                 volume_id,
                                                 {'tmp_status': 'mounting'})
    pre_mount = check_volume_task.si(driverCls, provider, identity,
                                     instance_id, volume_id)
    mount = mount_task.si(driverCls, provider, identity, instance_id,
                          volume_id, device, mount_location)
    post_mount = update_mount_location.s(driverCls, provider, identity,
                                         volume_id)
    post_mount_status = update_volume_metadata.si(driverCls, provider,
                                                  identity, volume_id,
                                                  {'tmp_status': ''})
    # Error Links
    pre_mount_status.link_error(
        mount_failed.s(driverCls, provider, identity, volume_id))
    pre_mount.link_error(
        mount_failed.s(driverCls, provider, identity, volume_id))
    mount.link_error(mount_failed.s(driverCls, provider, identity, volume_id))
    post_mount.link_error(
        mount_failed.s(driverCls, provider, identity, volume_id))
    post_mount_status.link_error(
        mount_failed.s(driverCls, provider, identity, volume_id))
    # Make a chain with link
    pre_mount_status.link(pre_mount)
    pre_mount.link(mount)
    mount.link(post_mount)
    post_mount.link(post_mount_status)
    # Return the head node
    return pre_mount_status
def _get_mount_chain(
    core_identity, driver, instance_id, volume_id, device_location,
    mount_location
):
    driverCls = driver.__class__
    provider = driver.provider
    identity = driver.identity
    core_provider = core_identity.provider
    fs_type = core_provider.get_config("deploy", "volume_fs_type", "ext4")
    mount_prefix = core_provider.get_config(
        "deploy", "volume_mount_prefix", "/vol_"
    )
    pre_mount_status = update_volume_metadata.si(
        driverCls, provider, identity, volume_id, {'tmp_status': 'mounting'}
    )
    pre_mount = check_volume_task.si(
        driverCls, provider, identity, instance_id, volume_id, fs_type
    )
    mount = mount_volume_task.si(
        driverCls,
        provider,
        identity,
        instance_id,
        volume_id,
        device_location,
        mount_location,
        fs_type,
        mount_prefix=mount_prefix
    )
    post_mount = update_mount_location.s(
        driverCls, provider, identity, volume_id
    )
    post_mount_status = update_volume_metadata.si(
        driverCls, provider, identity, volume_id, {'tmp_status': ''}
    )
    # Error Links
    pre_mount_status.link_error(
        mount_failed.s(driverCls, provider, identity, volume_id)
    )
    pre_mount.link_error(
        mount_failed.s(driverCls, provider, identity, volume_id)
    )
    mount.link_error(mount_failed.s(driverCls, provider, identity, volume_id))
    post_mount.link_error(
        mount_failed.s(driverCls, provider, identity, volume_id)
    )
    post_mount_status.link_error(
        mount_failed.s(driverCls, provider, identity, volume_id)
    )
    # Make a chain with link
    pre_mount_status.link(pre_mount)
    pre_mount.link(mount)
    mount.link(post_mount)
    post_mount.link(post_mount_status)
    # Return the head node
    return pre_mount_status
Example #5
0
def _get_mount_chain(core_identity, driver, instance_id, volume_id, device_location, mount_location):
    driverCls = driver.__class__
    provider = driver.provider
    identity = driver.identity
    core_provider = core_identity.provider
    fs_type = core_provider.get_config("deploy", "volume_fs_type", "ext4")
    mount_prefix = core_provider.get_config("deploy", "volume_mount_prefix", "/vol_")
    pre_mount_status = update_volume_metadata.si(
        driverCls, provider, identity,
        volume_id, {'tmp_status': 'mounting'})
    pre_mount = check_volume_task.si(
        driverCls, provider, identity,
        instance_id, volume_id, fs_type)
    mount = mount_task.si(
        driverCls, provider, identity,
        instance_id, volume_id, device_location, mount_location, fs_type,
        mount_prefix=mount_prefix)
    post_mount = update_mount_location.s(
        driverCls, provider, identity, volume_id)
    post_mount_status = update_volume_metadata.si(
        driverCls, provider, identity,
        volume_id, {'tmp_status': ''})
    # Error Links
    pre_mount_status.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    pre_mount.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    mount.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    post_mount.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    post_mount_status.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    # Make a chain with link
    pre_mount_status.link(pre_mount)
    pre_mount.link(mount)
    mount.link(post_mount)
    post_mount.link(post_mount_status)
    # Return the head node
    return pre_mount_status
Example #6
0
def _get_mount_chain(driver, instance_id, volume_id, device, mount_location):
    driverCls = driver.__class__
    provider = driver.provider
    identity = driver.identity

    pre_mount_status = update_volume_metadata.si(
            driverCls, provider, identity,
            volume_id, {'tmp_status':'mounting'})
    pre_mount = check_volume_task.si(
        driverCls, provider, identity,
        instance_id, volume_id)
    mount = mount_task.si(
            driverCls, provider, identity,
            instance_id, volume_id, device, mount_location)
    post_mount = update_mount_location.s(
            driverCls, provider, identity, volume_id)
    post_mount_status = update_volume_metadata.si(
            driverCls, provider, identity,
            volume_id, {'tmp_status':''})
    #Error Links
    pre_mount_status.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    pre_mount.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    mount.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    post_mount.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    post_mount_status.link_error(
        mount_failed.s(
            driverCls, provider, identity, volume_id))
    # Make a chain with link
    pre_mount_status.link(pre_mount)
    pre_mount.link(mount)
    mount.link(post_mount)
    post_mount.link(post_mount_status)
    #Return the head node
    return pre_mount_status