def _create_server(cs, image_name, ram_size):
    get_uuid = uuid.uuid4()
    server_name = 'worker-%s' % (get_uuid)
    print 'Creating server %s' % server_name

    image = _get_server_image(cs, image_name)
    if not image:
        raise Exception('Could not get server image "%s"' % image_name)

    flavor = _get_flavor(cs, ram_size)
    if not flavor:
        raise Exception('Could not get flavor with %s ram' % ram_size)

    server = cs.servers.create(
        server_name,
        image,
        flavor,
    )

    return server
dataset/ETHPy150Open nicholaskuechler/autoscale-rackspacecloud-fabric-celery/fabfile.py/_create_server/original