def update_fields(module, p):
    'This updates the module field names\n    to match the field names tower-cli expects to make\n    calling of the modify/delete methods easier.\n    '
    params = p.copy()
    field_map = {'fact_caching_enabled': 'use_fact_cache', 'ask_diff_mode': 'ask_diff_mode_on_launch', 'ask_extra_vars': 'ask_variables_on_launch', 'ask_limit': 'ask_limit_on_launch', 'ask_tags': 'ask_tags_on_launch', 'ask_skip_tags': 'ask_skip_tags_on_launch', 'ask_verbosity': 'ask_verbosity_on_launch', 'ask_inventory': 'ask_inventory_on_launch', 'ask_credential': 'ask_credential_on_launch', 'ask_job_type': 'ask_job_type_on_launch', 'diff_mode_enabled': 'diff_mode', 'concurrent_jobs_enabled': 'allow_simultaneous', 'force_handlers_enabled': 'force_handlers'}
    params_update = {}
    for (old_k, new_k) in field_map.items():
        v = params.pop(old_k)
        params_update[new_k] = v
    extra_vars = params.get('extra_vars')
    extra_vars_path = params.get('extra_vars_path')
    if extra_vars:
        params_update['extra_vars'] = [json.dumps(extra_vars)]
    elif (extra_vars_path is not None):
        params_update['extra_vars'] = [('@' + extra_vars_path)]
        module.deprecate(msg='extra_vars_path should not be used anymore. Use \'extra_vars: "{{ lookup(\'file\', \'/path/to/file\') | from_yaml }}"\' instead', version='3.8')
    params.update(params_update)
    return params
This updates the module field names
to match the field names tower-cli expects to make
calling of the modify/delete methods easier.
def update_fields(module, p):
    'This updates the module field names\n    to match the field names tower-cli expects to make\n    calling of the modify/delete methods easier.\n    '
    params = p.copy()
    field_map = {'fact_caching_enabled': 'use_fact_cache', 'ask_diff_mode': 'ask_diff_mode_on_launch', 'ask_extra_vars': 'ask_variables_on_launch', 'ask_limit': 'ask_limit_on_launch', 'ask_tags': 'ask_tags_on_launch', 'ask_skip_tags': 'ask_skip_tags_on_launch', 'ask_verbosity': 'ask_verbosity_on_launch', 'ask_inventory': 'ask_inventory_on_launch', 'ask_credential': 'ask_credential_on_launch', 'ask_job_type': 'ask_job_type_on_launch', 'diff_mode_enabled': 'diff_mode', 'concurrent_jobs_enabled': 'allow_simultaneous', 'force_handlers_enabled': 'force_handlers'}
    params_update = {}
    for (old_k, new_k) in field_map.items():
        v = params.pop(old_k)
        params_update[new_k] = v
    extra_vars = params.get('extra_vars')
    extra_vars_path = params.get('extra_vars_path')
    if extra_vars:
        params_update['extra_vars'] = [json.dumps(extra_vars)]
    elif (extra_vars_path is not None):
        params_update['extra_vars'] = [('@' + extra_vars_path)]
        module.deprecate(msg='extra_vars_path should not be used anymore. Use \'extra_vars: "{{ lookup(\'file\', \'/path/to/file\') | from_yaml }}"\' instead', version='3.8')
    params.update(params_update)
    return params