-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Adding enos_command module and unit test #32782
Conversation
Please review these and merge it . |
@amuraleedhar this PR contains more than one new module. Please submit only one new module per pullrequest. For further explanation, please read grouped module documentation |
Please review the enos_command module and merge it . |
password: admin | ||
timeout: 30 | ||
authorize: True | ||
auth_pass: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value is missing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing auth_pass as its not required by default.
module = AnsibleModule(argument_spec=spec, supports_check_mode=True) | ||
|
||
warnings = list() | ||
check_args(module, warnings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is check_args
call required, as the function is empty? Fo other network modules it is present due to legacy reasons which need to removed in respective platform modules refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor comments
See examples. | ||
required: false | ||
default: null | ||
aliases: ['waitfor'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line. This is only in old modules for backwards compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
# { command: <str>, prompt: <str>, response: <str> } | ||
commands=dict(type='list', required=True), | ||
|
||
wait_for=dict(type='list', aliases=['waitfor']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove , aliases=['waitfor']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
@@ -0,0 +1,220 @@ | |||
#!/usr/bin/python | |||
# | |||
# Copyright: Ansible Project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lenovo copyright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes Changing it.
@@ -0,0 +1,103 @@ | |||
# (c) 2016 Red Hat Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
Lenovo copyright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Changing it
Merged into |
SUMMARY
Creating the command module for enos from Lenovo.
ISSUE TYPE
New Module Pull Request
COMPONENT NAME
lib/ansible/modules/network/enos/enos_command.py
test/units/modules/network/enos/test_enos_command.py
ANSIBLE VERSION
ansible 2.5.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible-2.5.0-py2.7.egg/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
ADDITIONAL INFORMATION
This is part of an effort to create modules for enos based switches from Lenovo.