New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR to remove dependency from tower cli and includes tower lookup plugin support #48649

Open
wants to merge 19 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@justjais
Contributor

justjais commented Nov 14, 2018

SUMMARY

PR to remove the dependency from tower_cli and handles the connection to Ansible tower instance from within the Ansible modules. Also, PR includes the first tower lookup plugin which is generic in nature and can be used to query all available ansible tower objects.

ISSUE TYPE
  • Feature Pull Request
  • New Module Pull Request
COMPONENT NAME

ansible tower

ANSIBLE VERSION

2.8

ADDITIONAL INFORMATION

justjais added some commits Nov 14, 2018

replace tower_cli
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
replace tower_cli
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
replace tower_cli
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
replace tower_cli
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
replace tower_cli
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
replace tower_cli
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
replace tower_cli
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
tower lookup pluggin
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

@justjais justjais requested a review from privateip Nov 14, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Nov 14, 2018

Hi @justjais, thank you for submitting this pull-request!

click here for bot help

@ansibot

This comment has been minimized.

Contributor

ansibot commented Nov 14, 2018

The test ansible-test sanity --test pylint [explain] failed with 10 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:46:4: ansible-bad-module-import Import external package or ansible.module_utils not ansible.utils.display
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:94:12: undefined-variable Undefined variable 'debug'
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:119:12: using-constant-test Using a conditional statement with a constant value
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:120:45: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:217:38: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:222:37: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:29:23: undefined-all-variable Undefined variable name 'with_global_options' in __all__
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:29:46: undefined-all-variable Undefined variable name 'pop_option' in __all__
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:36:4: ansible-bad-module-import Import external package or ansible.module_utils not ansible.utils.display
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:72:11: undefined-variable Undefined variable 'exceptions'

The test ansible-test sanity --test import --python 2.6 [explain] failed with 4 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:46:0: ImportError: No module named utils.display
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:24:0: ImportError: No module named six
lib/ansible/module_utils/web_infrastructure/ansible_tower/exceptions.py:16:0: ImportError: No module named click
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:16:0: ImportError: No module named yaml

The test ansible-test sanity --test import --python 2.7 [explain] failed with 4 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:46:0: ImportError: No module named utils.display
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:24:0: ImportError: No module named six
lib/ansible/module_utils/web_infrastructure/ansible_tower/exceptions.py:16:0: ImportError: No module named click
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:16:0: ImportError: No module named yaml

The test ansible-test sanity --test import --python 3.5 [explain] failed with 4 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:46:0: ImportError: No module named 'ansible.utils'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:24:0: ImportError: No module named 'six'
lib/ansible/module_utils/web_infrastructure/ansible_tower/exceptions.py:16:0: ImportError: No module named 'click'
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:16:0: ImportError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.6 [explain] failed with 4 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:46:0: ModuleNotFoundError: No module named 'ansible.utils'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:24:0: ModuleNotFoundError: No module named 'six'
lib/ansible/module_utils/web_infrastructure/ansible_tower/exceptions.py:16:0: ModuleNotFoundError: No module named 'click'
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:16:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.7 [explain] failed with 4 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:46:0: ModuleNotFoundError: No module named 'ansible.utils'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:24:0: ModuleNotFoundError: No module named 'six'
lib/ansible/module_utils/web_infrastructure/ansible_tower/exceptions.py:16:0: ModuleNotFoundError: No module named 'click'
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:16:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test no-assert [explain] failed with 4 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:150:11: raise AssertionError instead of: assert type(return_dict) is dict
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:156:13: raise AssertionError instead of: assert type(return_dict) is dict
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:160:13: raise AssertionError instead of: assert allow_kv
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:205:13: raise AssertionError instead of: assert type(try_dict) is dict

The test ansible-test sanity --test no-underscore-variable [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:183:24: use `dummy` instead of `_` for a variable name

The test ansible-test sanity --test use-compat-six [explain] failed with 4 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:24:1: use `ansible.module_utils.six` instead of `six`
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:25:1: use `ansible.module_utils.six` instead of `six`
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:26:1: use `ansible.module_utils.six` instead of `six`
lib/ansible/module_utils/web_infrastructure/ansible_tower/utils.py:22:1: use `ansible.module_utils.six` instead of `six`

click here for bot help

justjais added some commits Nov 28, 2018

cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

justjais added some commits Nov 28, 2018

cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
cleanup
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
@ansibot

This comment has been minimized.

Contributor

ansibot commented Nov 28, 2018

The test ansible-test sanity --test pylint [explain] failed with 14 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:44:4: ansible-bad-module-import Import external package or ansible.module_utils not ansible.utils.display
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:90:12: undefined-variable Undefined variable 'debug'
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:115:12: using-constant-test Using a conditional statement with a constant value
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:116:45: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:195:38: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:200:37: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:23:0: useless-import-alias Import alias does not rename original package
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:32:23: undefined-all-variable Undefined variable name 'with_global_options' in __all__
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:32:46: undefined-all-variable Undefined variable name 'pop_option' in __all__
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:335:11: undefined-variable Undefined variable 'exceptions'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:367:22: undefined-variable Undefined variable 'yaml'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:370:28: undefined-variable Undefined variable 'yaml'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:374:26: undefined-variable Undefined variable 'parse_kv'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:376:18: undefined-variable Undefined variable 'exc'

The test ansible-test sanity --test import --python 2.6 [explain] failed with 2 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:44:0: ImportError: No module named utils.display
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:30:0: ImportError: No module named ordereddict

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:44:0: ImportError: No module named utils.display

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:44:0: ImportError: No module named 'ansible.utils'

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:44:0: ModuleNotFoundError: No module named 'ansible.utils'

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:44:0: ModuleNotFoundError: No module named 'ansible.utils'

The test ansible-test sanity --test no-assert [explain] failed with 3 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:363:11: raise AssertionError instead of: assert type(return_dict) is dict
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:369:13: raise AssertionError instead of: assert type(return_dict) is dict
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:373:13: raise AssertionError instead of: assert allow_kv

The test ansible-test sanity --test no-main-display [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:42:5: Display is a singleton, just import and instantiate

The test ansible-test sanity --test pep8 [explain] failed with 2 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:317:17: E128 continuation line under-indented for visual indent
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:318:17: E128 continuation line under-indented for visual indent

click here for bot help

justjais added some commits Nov 29, 2018

fix errors
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
fix errors
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

@ansibot ansibot removed the ci_verified label Nov 29, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Nov 29, 2018

The test ansible-test sanity --test pylint [explain] failed with 13 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:40:0: ansible-bad-module-import Import external package or ansible.module_utils not ansible.utils.display
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:109:12: using-constant-test Using a conditional statement with a constant value
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:110:51: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:185:38: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:190:37: ansible-format-automatic-specification Format string contains automatic field numbering specification
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:23:0: useless-import-alias Import alias does not rename original package
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:32:23: undefined-all-variable Undefined variable name 'with_global_options' in __all__
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:32:46: undefined-all-variable Undefined variable name 'pop_option' in __all__
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:335:11: undefined-variable Undefined variable 'exceptions'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:362:22: undefined-variable Undefined variable 'yaml'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:366:28: undefined-variable Undefined variable 'yaml'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:371:26: undefined-variable Undefined variable 'parse_kv'
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:373:18: undefined-variable Undefined variable 'exc'

The test ansible-test sanity --test import --python 2.6 [explain] failed with 2 errors:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:40:0: ImportError: No module named utils.display
lib/ansible/module_utils/web_infrastructure/ansible_tower/conf.py:30:0: ImportError: No module named ordereddict

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:40:0: ImportError: No module named utils.display

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:40:0: ImportError: No module named 'ansible.utils'

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:40:0: ModuleNotFoundError: No module named 'ansible.utils'

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/module_utils/web_infrastructure/ansible_tower/api.py:40:0: ModuleNotFoundError: No module named 'ansible.utils'

click here for bot help

@ansibot ansibot added the stale_ci label Dec 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment