def run(dry_run, io_dir='throughput/'):
    unleash_instances = queries.get_unleash_instances()
    for unleash_instance in unleash_instances:
        instance_name = unleash_instance['name']
        instance_url = unleash_instance['url']
        current_state = fetch_current_state(unleash_instance)
        previous_state = fetch_previous_state(io_dir, instance_name)
        if previous_state:
            diffs = calculate_diff(instance_url, current_state, previous_state)
            act(dry_run, unleash_instance, diffs)
        write_state(io_dir, instance_name, current_state)
def run(dry_run):
    unleash_instances = queries.get_unleash_instances()
    accounts = queries.get_aws_accounts()
    settings = queries.get_app_interface_settings()
    state = State(integration=QONTRACT_INTEGRATION,
                  accounts=accounts,
                  settings=settings)
    for unleash_instance in unleash_instances:
        instance_name = unleash_instance['name']
        current_state = fetch_current_state(unleash_instance)
        previous_state = fetch_previous_state(state, instance_name)
        diffs = calculate_diff(current_state, previous_state)
        if diffs:
            act(dry_run, state, unleash_instance, diffs)
Пример #3
0
def run(dry_run):
    unleash_instances = queries.get_unleash_instances()
    accounts = queries.get_state_aws_accounts()
    settings = queries.get_app_interface_settings()
    state = State(integration=QONTRACT_INTEGRATION,
                  accounts=accounts,
                  settings=settings)
    for unleash_instance in unleash_instances:
        instance_name = unleash_instance['name']
        current_state = fetch_current_state(unleash_instance)
        if not current_state:
            logging.warning('not acting on empty Unleash instances. ' +
                            'please create a feature toggle to get started.')
            continue
        previous_state = fetch_previous_state(state, instance_name)
        diffs = calculate_diff(current_state, previous_state)
        if diffs:
            act(dry_run, state, unleash_instance, diffs)