def delete_security_group(security_group_uuid, transition_entity=None):
    security_group = transition_entity

    chain(
        openstack_create_session.s(
            membership_id=security_group.cloud_project_membership.id),
        openstack_delete_security_group.s(security_group_uuid),
    ).apply_async(
        link=security_group_deletion_succeeded.si(security_group_uuid),
        link_error=security_group_sync_failed.si(security_group_uuid),
    )
Beispiel #2
0
def resize_flavor(instance_uuid, flavor_uuid, transition_entity=None):
    instance = transition_entity
    cloud = instance.cloud_project_membership.cloud
    flavor = cloud.flavors.get(uuid=flavor_uuid)
    server_id = instance.backend_id
    flavor_id = flavor.backend_id

    chain(
        openstack_create_session.s(instance_uuid=instance_uuid),
        nova_server_resize.s(server_id, flavor_id),
        nova_wait_for_server_status.s(server_id, 'VERIFY_RESIZE'),
        nova_server_resize_confirm.s(server_id),
        nova_wait_for_server_status.s(server_id, 'SHUTOFF'),
    ).apply_async(
        link=flavor_change_succeeded.si(instance_uuid, flavor_uuid),
        link_error=flavor_change_failed.si(instance_uuid, flavor_uuid),
    )