コード例 #1
0
ファイル: task.py プロジェクト: nfaction/atmosphere
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
コード例 #2
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_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
コード例 #3
0
ファイル: task.py プロジェクト: waterstroke/atmosphere
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
コード例 #4
0
ファイル: task.py プロジェクト: Angelfirenze/atmosphere
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