diff --git a/awx/main/tasks.py b/awx/main/tasks.py index d41f21b087..374f9f9f22 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1822,7 +1822,7 @@ class RunInventoryUpdate(BaseTask): cp.set(section, 'ssl_verify', "false") cloudforms_opts = dict(inventory_update.source_vars_dict.items()) - for opt in ['version', 'purge_actions', 'clean_group_keys', 'nest_tags', 'suffix']: + for opt in ['version', 'purge_actions', 'clean_group_keys', 'nest_tags', 'suffix', 'prefer_ipv4']: if opt in cloudforms_opts: cp.set(section, opt, cloudforms_opts[opt]) diff --git a/awx/main/tests/unit/test_tasks.py b/awx/main/tests/unit/test_tasks.py index c80dbda6f9..8c4698b004 100644 --- a/awx/main/tests/unit/test_tasks.py +++ b/awx/main/tests/unit/test_tasks.py @@ -1757,6 +1757,8 @@ class TestInventoryUpdateCredentials(TestJobExecution): self.instance.credential, 'password' ) + self.instance.source_vars_dict['prefer_ipv4'] = True + def run_pexpect_side_effect(*args, **kwargs): args, cwd, env, stdout = args config = ConfigParser.ConfigParser() @@ -1765,6 +1767,7 @@ class TestInventoryUpdateCredentials(TestJobExecution): assert config.get('cloudforms', 'username') == 'bob' assert config.get('cloudforms', 'password') == 'secret' assert config.get('cloudforms', 'ssl_verify') == 'false' + assert config.get('cloudforms', 'prefer_ipv4') == 'true' cache_path = config.get('cache', 'path') assert cache_path.startswith(env['AWX_PRIVATE_DATA_DIR'])