-
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
network command modules cleanup #45242
Conversation
|
||
|
||
def parse_commands(module, warnings): | ||
spec = dict( | ||
transform = ComplexList(dict( |
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.
Can the logic of creating ComplexList object moved to a common location with the updated spec. This change can add support for multiple prompts and multiple answers for platform-specific command modules without any code change in the module (doc might be required to be updated)
transform = ComplexList(dict(
command=dict(key=True),
prompt=dict(type='list'),
answer=dict(type='list'),
sendonly=dict(type='bool', default=False),
check_all=dict(type='bool', default=False),
), module)
commands = transform(module.params['commands'])
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.
Yeah, this could probably be centralized. The thing I'm not sure about is that only some of the modules want output
as a key and I'm not sure if including that will introduce problems.
It seems like it shouldn't be a problem; I don't think it should create unnecessary keys, but I'll have to look into it.
CI failure in unit tests: https://app.shippable.com/github/ansible/ansible/runs/82624/4/tests The network integration tests are also failing with a traceback: https://app.shippable.com/github/ansible/ansible/runs/82624/29/console |
bfd6050
to
6573627
Compare
CI failure in integration tests: https://app.shippable.com/github/ansible/ansible/runs/83629/29/console |
Also include iosxr in the fun
The test
|
SUMMARY
This started as a cleanup to some useless code in ios_command, that then bled over to other command modules.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION