mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 01:44:03 -07:00
Deprecate Entity, EntityCollection and use subspec in network modules (#33575)
* Deprecate Entity, EntityCollection and use subspec in network modules * As per proposal https://github.com/ansible/proposals/issues/76 deprecate use of Entity, EntityCollection, ComplexDict, ComplexList and use subspec instead. * Refactor ios modules * Refactor eos modules * Refactor vyos modules * Refactor nxos modules * Refactor iosxr modules * Add support for key in suboptions handling * Fix CI issues
This commit is contained in:
parent
a23da23491
commit
4349b56643
15 changed files with 195 additions and 200 deletions
|
@ -137,7 +137,6 @@ import time
|
|||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils.network.common.parsing import Conditional
|
||||
from ansible.module_utils.network.common.utils import ComplexList
|
||||
from ansible.module_utils.six import string_types
|
||||
from ansible.module_utils.network.vyos.vyos import run_commands
|
||||
from ansible.module_utils.network.vyos.vyos import vyos_argument_spec
|
||||
|
@ -151,12 +150,7 @@ def to_lines(stdout):
|
|||
|
||||
|
||||
def parse_commands(module, warnings):
|
||||
command = ComplexList(dict(
|
||||
command=dict(key=True),
|
||||
prompt=dict(),
|
||||
answer=dict(),
|
||||
), module)
|
||||
commands = command(module.params['commands'])
|
||||
commands = module.params['commands']
|
||||
items = []
|
||||
|
||||
for item in commands:
|
||||
|
@ -170,8 +164,15 @@ def parse_commands(module, warnings):
|
|||
|
||||
|
||||
def main():
|
||||
|
||||
command_spec = dict(
|
||||
command=dict(key=True),
|
||||
prompt=dict(),
|
||||
answer=dict()
|
||||
)
|
||||
|
||||
spec = dict(
|
||||
commands=dict(type='list', required=True),
|
||||
commands=dict(type='list', elements='dict', options=command_spec, required=True),
|
||||
|
||||
wait_for=dict(type='list', aliases=['waitfor']),
|
||||
match=dict(default='all', choices=['all', 'any']),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue