-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Pluribus Networks pn access list ip module #49352
Pluribus Networks pn access list ip module #49352
Conversation
Hi @rajaspachipulusu17, thank you for submitting this pull-request! |
The test
The test
The test
The test
The test
The test
The test
The test
The test
|
@rajaspachipulusu17, just so you are aware we have a dedicated Working Group for network. |
version_added: "2.8" | ||
short_description: CLI command to add/remove access-list-ip | ||
description: | ||
- This modules is used to dd IPs associated with access list |
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.
- This modules is used to dd IPs associated with access list | |
- This modules is used to add IPs associated with access list |
choices: [ "present", "absent"] | ||
pn_ip: | ||
description: | ||
- IP associated with the access list |
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.
- IP associated with the access list | |
- IP associated with the access list. |
default: '::' | ||
pn_name: | ||
description: | ||
- Access List Name |
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.
- Access List Name | |
- Access List Name. |
name = module.params['pn_name'] | ||
ip = module.params['pn_ip'] | ||
|
||
show = cli + \ |
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.
show = [cli, 'access-list-ip-show', 'name', name, 'format', 'ip', 'no-show-headers']
out = module.run_command(show, use_unsafe_shell=True)[1]
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.
ok let change and test and send it for review.
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.
Above show which you have suggested wont split my cli parameter.
Hence i have concatenated the string before using it in run_command.
out = module.run_command(cli.split(), use_unsafe_shell=True)[1]
type: bool | ||
""" | ||
|
||
import shlex |
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.
run_command
internally uses shlex. You need to pass command as list and use use_unsafe_shell=True
. You can find the documentation here -
ansible/lib/ansible/module_utils/basic.py
Line 2702 in 68cafbd
:arg args: is the command to run |
@rajaspachipulusu17 Could you please add test case for this change ? Thanks. |
The test
|
Unit test cases are ready. Should i create seperate PR or can i send it in same PR? Thanks, |
@rajaspachipulusu17 if unit tests are related |
closing this PR, as i deleted branch accidentally. new PR is 49604 |
@rajaspachipulusu17 Your branch does not contain a shippable.yml file. Please rebase your branch to trigger running of current tests. |
Closing in favour of #49604 |
SUMMARY
ISSUE TYPE
COMPONENT NAME
pn_access_list_ip module which would add associate ip address to access list.
ADDITIONAL INFORMATION
ansible 2.4.0.0
config file = None
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
executable location = /usr/local/bin/ansible
python version = 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]