コード例 #1
0
def reload_as_group(as_group):
    try:
        return as_group.connection.get_all_groups([as_group.name])[0]

    except BotoServerError as e:
        throttle_response(e)
        return reload_as_group(as_group)
コード例 #2
0
def reload_as_group(as_group):
    try:
        return as_group.connection.get_all_groups([as_group.name])[0]

    except BotoServerError as e:
        throttle_response(e)
        return reload_as_group(as_group)
コード例 #3
0
def get_spot_lcs(as_conn):
    try:
        return [
            l for l in as_conn.get_all_launch_configurations() if l.spot_price
        ]
    except BotoServerError as e:
        throttle_response(e)
        return get_spot_lcs(as_conn)
コード例 #4
0
def terminate_instance(instance):
    try:
        instance.connection.terminate_instance(
            instance.instance_id, decrement_capacity=False)
        time.sleep(30)
    except BotoServerError as e:
        throttle_response(e)
        return terminate_instance(instance)
    except Exception as e:
        handle_exception(e)
        sys.exit(1)
コード例 #5
0
def terminate_instance(instance):
    try:
        instance.connection.terminate_instance(instance.instance_id,
                                               decrement_capacity=False)
        time.sleep(30)
    except BotoServerError as e:
        throttle_response(e)
        return terminate_instance(instance)
    except Exception as e:
        handle_exception(e)
        sys.exit(1)
コード例 #6
0
def kill_with_fire(launch_config):
    try:
        launch_config.delete()
    except BotoServerError as e:
        throttle_response(e)
        return kill_with_fire(launch_config)
コード例 #7
0
def kill_with_fire(launch_config):
    try:
        launch_config.delete()
    except BotoServerError as e:
        throttle_response(e)
        return kill_with_fire(launch_config)
コード例 #8
0
def get_all_as_groups(as_conn):
    try:
        return as_conn.get_all_groups()
    except BotoServerError as e:
        throttle_response(e)
        return get_all_as_groups(as_conn)
コード例 #9
0
def get_all_as_groups(as_conn):
    try:
        return as_conn.get_all_groups()
    except BotoServerError as e:
        throttle_response(e)
        return get_all_as_groups(as_conn)
コード例 #10
0
def get_spot_lcs(as_conn):
    try:
        return [l for l in as_conn.get_all_launch_configurations() if l.spot_price]
    except BotoServerError as e:
        throttle_response(e)
        return get_spot_lcs(as_conn)