Example #1
0
def get_config():
    if not has_state():
        raise Exception("Can't get a config without a state file")
    saved_state = load_state()
    cloud = saved_state['cloud']
    config = parse_config(CLOUD_YAML_FILE[cloud])
    return config
Example #2
0
def status():
    """ returns current status of the instance """
    config = get_config()
    pp = PrettyPrinter(indent=4)
    pp.pprint(config)
    if has_state():
        state = load_state()
        pp.pprint(state)
Example #3
0
def up():
    """
    boots a new instance on the specified cloud provider
    """
    if not has_state():
        cloud = env.config['cloud']
        distro = Distribution(env.config['distribution'])
        region = env.config['region']
        create_new_intance_from_config(cloud, distro, region)
    else:
        create_instance_from_saved_state()