Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(9)  |  Call(8)  |  Derive(0)  |  Import(1)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/logic/management/commands/server-import.py   synnefo(Download)
from synnefo.db.models import VirtualMachine, Network, Flavor, VolumeType
from synnefo.logic.utils import id_from_network_name, id_from_instance_name
from synnefo.logic.backend import wait_for_job, connect_to_network
from snf_django.management.commands import SynnefoCommand
from synnefo.logic.rapi import GanetiApiError
    op.reverse()
    jobid = backend_client.ModifyInstance(instance_name, nics=op)
    (status, error) = wait_for_job(backend_client, jobid)
    if status != 'success':
        raise CommandError("Cannot remove instance NICs: %s" % error)
def add_public_nic(instance_name, nic, backend_client, stream):
    stream.write("Adding public NIC %s\n" % nic)
    jobid = backend_client.ModifyInstance(instance_name, nics=[('add', nic)])
    (status, error) = wait_for_job(backend_client, jobid)
    if status != 'success':
        stream.write("Instance is not down. Shutting down instance...\n")
        jobid = backend_client.ShutdownInstance(instance_name)
        (status, error) = wait_for_job(backend_client, jobid)
        if status != 'success':
            raise CommandError("Cannot shutdown instance: %s" % error)
    jobid = backend_client.RenameInstance(old_name, new_name,
                                          ip_check=False, name_check=False)
    (status, error) = wait_for_job(backend_client, jobid)
    if status != 'success':
        raise CommandError("Cannot rename instance: %s" % error)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/volume/management/commands/volume-import.py   synnefo(Download)
            disks=[("modify", disk["index"],
                    {"name": volume.backend_volume_uuid})])
        (status, error) = backend_mod.wait_for_job(client, jobId)
        vm.put_client(client)
        if status == "success":

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/quotas/enforce.py   synnefo(Download)
def wait_server_job(server):
    jobID = server.task_job_id
    client = server.get_client()
    status, error = backend.wait_for_job(client, jobID)
    if status != "success":

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/management/common.py   synnefo(Download)
def wait_ganeti_job(client, jobID, stdout):
    status, error = backend_mod.wait_for_job(client, jobID)
    if status == "success":
        stdout.write("Job finished successfully.\n")
    else: