diff --git a/changelogs/fragments/remove_ignores_for_sanity.yaml b/changelogs/fragments/remove_ignores_for_sanity.yaml new file mode 100644 index 00000000..ff89ac90 --- /dev/null +++ b/changelogs/fragments/remove_ignores_for_sanity.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - Makes sure that docstring and argspec are in sync and removes sanity ignores (https://github.com/ansible-collections/cisco.iosxr/pull/62). diff --git a/plugins/doc_fragments/iosxr.py b/plugins/doc_fragments/iosxr.py index 51341177..9e552ded 100644 --- a/plugins/doc_fragments/iosxr.py +++ b/plugins/doc_fragments/iosxr.py @@ -26,12 +26,10 @@ class ModuleDocFragment(object): over the specified transport. The value of host is used as the destination address for the transport. type: str - required: true port: description: - Specifies the port to use when building the connection to the remote device. type: int - default: 22 username: description: - Configures the username to use to authenticate the connection to the remote @@ -52,7 +50,6 @@ class ModuleDocFragment(object): for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. type: int - default: 10 ssh_keyfile: description: - Specifies the SSH key to use to authenticate the connection to the remote @@ -60,6 +57,14 @@ class ModuleDocFragment(object): session. If the value is not specified in the task, the value of environment variable C(ANSIBLE_NET_SSH_KEYFILE) will be used instead. type: path + transport: + description: + - Specifies the type of connection based transport. + type: str + default: cli + choices: + - cli + - netconf notes: - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide ` diff --git a/plugins/module_utils/network/iosxr/argspec/facts/facts.py b/plugins/module_utils/network/iosxr/argspec/facts/facts.py index ea1ac50b..af84f8be 100644 --- a/plugins/module_utils/network/iosxr/argspec/facts/facts.py +++ b/plugins/module_utils/network/iosxr/argspec/facts/facts.py @@ -20,6 +20,8 @@ def __init__(self, **kwargs): pass argument_spec = { - "gather_subset": dict(default=["!config"], type="list"), - "gather_network_resources": dict(type="list"), + "gather_subset": dict( + default=["!config"], type="list", elements="str" + ), + "gather_network_resources": dict(type="list", elements="str"), } diff --git a/plugins/module_utils/network/iosxr/argspec/l2_interfaces/l2_interfaces.py b/plugins/module_utils/network/iosxr/argspec/l2_interfaces/l2_interfaces.py index ba10045c..30145526 100644 --- a/plugins/module_utils/network/iosxr/argspec/l2_interfaces/l2_interfaces.py +++ b/plugins/module_utils/network/iosxr/argspec/l2_interfaces/l2_interfaces.py @@ -42,7 +42,7 @@ def __init__(self, **kwargs): "native_vlan": {"type": "int"}, "l2transport": {"type": "bool"}, "l2protocol": { - "element": "dict", + "elements": "dict", "type": "list", "options": { "cdp": { @@ -63,7 +63,7 @@ def __init__(self, **kwargs): }, }, }, - "q_vlan": {"type": "list"}, + "q_vlan": {"type": "list", "elements": "int"}, "propagate": {"type": "bool"}, }, "type": "list", diff --git a/plugins/module_utils/network/iosxr/argspec/l3_interfaces/l3_interfaces.py b/plugins/module_utils/network/iosxr/argspec/l3_interfaces/l3_interfaces.py index ebac4c61..2e63dae9 100644 --- a/plugins/module_utils/network/iosxr/argspec/l3_interfaces/l3_interfaces.py +++ b/plugins/module_utils/network/iosxr/argspec/l3_interfaces/l3_interfaces.py @@ -40,7 +40,7 @@ def __init__(self, **kwargs): "options": { "name": {"type": "str", "required": True}, "ipv4": { - "element": "dict", + "elements": "dict", "type": "list", "options": { "address": {"type": "str"}, @@ -48,7 +48,7 @@ def __init__(self, **kwargs): }, }, "ipv6": { - "element": "dict", + "elements": "dict", "type": "list", "options": {"address": {"type": "str"}}, }, diff --git a/plugins/module_utils/network/iosxr/argspec/ospfv2/ospfv2.py b/plugins/module_utils/network/iosxr/argspec/ospfv2/ospfv2.py index e30e8de8..fb41a1e3 100644 --- a/plugins/module_utils/network/iosxr/argspec/ospfv2/ospfv2.py +++ b/plugins/module_utils/network/iosxr/argspec/ospfv2/ospfv2.py @@ -99,7 +99,22 @@ def __init__(self, **kwargs): }, "type": "dict", }, - "bfd": {"type": "dict"}, + "bfd": { + "options": { + "fast_detect": { + "options": { + "set": {"type": "bool"}, + "strict_mode": { + "type": "bool" + }, + }, + "type": "dict", + }, + "minimum_interval": {"type": "int"}, + "multiplier": {"type": "int"}, + }, + "type": "dict", + }, "cost": {"type": "int"}, "dead_interval": {"type": "int"}, "default_cost": {"type": "int"}, @@ -447,15 +462,6 @@ def __init__(self, **kwargs): "type": "str", }, "max_lsa": { - "mutually_exclusive": [ - [ - "warning_only", - "ignore_count", - "reset_time", - "ignore_time", - "ignore_count", - ] - ], "options": { "ignore_count": {"type": "int"}, "ignore_time": {"type": "int"}, diff --git a/plugins/module_utils/network/iosxr/config/interfaces/interfaces.py b/plugins/module_utils/network/iosxr/config/interfaces/interfaces.py index 1ea61f25..ce3534b5 100644 --- a/plugins/module_utils/network/iosxr/config/interfaces/interfaces.py +++ b/plugins/module_utils/network/iosxr/config/interfaces/interfaces.py @@ -167,9 +167,10 @@ def _state_replaced(self, want, have): for interface in want: for each in have: - if each["name"] == interface["name"]: - break - elif interface["name"] in each["name"]: + if ( + each["name"] == interface["name"] + or interface["name"] in each["name"] + ): break else: continue @@ -192,9 +193,10 @@ def _state_overridden(self, want, have): for each in have: for interface in want: - if each["name"] == interface["name"]: - break - elif interface["name"] in each["name"]: + if ( + each["name"] == interface["name"] + or interface["name"] in each["name"] + ): break else: # We didn't find a matching desired state, which means we can @@ -224,9 +226,10 @@ def _state_merged(self, want, have): commands.extend(self._set_config(interface, dict())) else: for each in have: - if each["name"] == interface["name"]: - break - elif interface["name"] in each["name"]: + if ( + each["name"] == interface["name"] + or interface["name"] in each["name"] + ): break else: continue @@ -245,9 +248,10 @@ def _state_deleted(self, want, have): if want: for interface in want: for each in have: - if each["name"] == interface["name"]: - break - elif interface["name"] in each["name"]: + if ( + each["name"] == interface["name"] + or interface["name"] in each["name"] + ): break else: continue diff --git a/plugins/module_utils/network/iosxr/config/l2_interfaces/l2_interfaces.py b/plugins/module_utils/network/iosxr/config/l2_interfaces/l2_interfaces.py index 7d150889..3002051e 100644 --- a/plugins/module_utils/network/iosxr/config/l2_interfaces/l2_interfaces.py +++ b/plugins/module_utils/network/iosxr/config/l2_interfaces/l2_interfaces.py @@ -195,7 +195,7 @@ def _state_overridden(self, want, have, module): if each["name"] == interface["name"]: in_have.add(interface["name"]) break - elif interface["name"] != each["name"]: + if interface["name"] != each["name"]: not_in_have.add(interface["name"]) else: # We didn't find a matching desired state, which means we can @@ -229,9 +229,10 @@ def _state_merged(self, want, have, module): for interface in want: interface["name"] = normalize_interface(interface["name"]) for each in have: - if each["name"] == interface["name"]: - break - elif interface["name"] in each["name"]: + if ( + each["name"] == interface["name"] + or interface["name"] in each["name"] + ): break else: commands.extend(self._set_config(interface, {}, module)) @@ -252,9 +253,10 @@ def _state_deleted(self, want, have): for interface in want: interface["name"] = normalize_interface(interface["name"]) for each in have: - if each["name"] == interface["name"]: - break - elif interface["name"] in each["name"]: + if ( + each["name"] == interface["name"] + or interface["name"] in each["name"] + ): break else: continue diff --git a/plugins/module_utils/network/iosxr/config/l3_interfaces/l3_interfaces.py b/plugins/module_utils/network/iosxr/config/l3_interfaces/l3_interfaces.py index 9921d2bc..8377e015 100644 --- a/plugins/module_utils/network/iosxr/config/l3_interfaces/l3_interfaces.py +++ b/plugins/module_utils/network/iosxr/config/l3_interfaces/l3_interfaces.py @@ -200,7 +200,7 @@ def _state_overridden(self, want, have, module): if each["name"] == interface["name"]: in_have.add(interface["name"]) break - elif interface["name"] != each["name"]: + if interface["name"] != each["name"]: not_in_have.add(interface["name"]) else: # We didn't find a matching desired state, which means we can @@ -260,9 +260,10 @@ def _state_deleted(self, want, have): for interface in want: interface["name"] = normalize_interface(interface["name"]) for each in have: - if each["name"] == interface["name"]: - break - elif interface["name"] in each["name"]: + if ( + each["name"] == interface["name"] + or interface["name"] in each["name"] + ): break else: continue @@ -297,7 +298,7 @@ def verify_diff_again(self, want, have): ): diff = True break - elif each_want.get("address") != every_have.get( + if each_want.get("address") != every_have.get( "address" ) and len(each_want.keys()) == len(every_have.keys()): diff = True diff --git a/plugins/module_utils/network/iosxr/facts/legacy/base.py b/plugins/module_utils/network/iosxr/facts/legacy/base.py index 2204efe1..463190cd 100644 --- a/plugins/module_utils/network/iosxr/facts/legacy/base.py +++ b/plugins/module_utils/network/iosxr/facts/legacy/base.py @@ -184,7 +184,7 @@ def parse_interfaces(self, data): for line in data.split("\n"): if len(line) == 0: continue - elif line[0] == " ": + if line[0] == " ": parsed[key] += "\n%s" % line else: match = re.match(r"^(\S+)", line) diff --git a/plugins/module_utils/network/iosxr/iosxr.py b/plugins/module_utils/network/iosxr/iosxr.py index c09c8d41..78e0544f 100644 --- a/plugins/module_utils/network/iosxr/iosxr.py +++ b/plugins/module_utils/network/iosxr/iosxr.py @@ -115,7 +115,10 @@ iosxr_argument_spec = { "provider": dict( - type="dict", options=iosxr_provider_spec, removed_in_version=2.14 + type="dict", + options=iosxr_provider_spec, + removed_at_date="2022-06-01", + removed_from_collection="cisco.iosxr", ) } diff --git a/plugins/module_utils/network/iosxr/utils/utils.py b/plugins/module_utils/network/iosxr/utils/utils.py index 712dc548..e06be0cf 100644 --- a/plugins/module_utils/network/iosxr/utils/utils.py +++ b/plugins/module_utils/network/iosxr/utils/utils.py @@ -81,13 +81,13 @@ def filter_dict_having_none_value(want, have): for k, v in iteritems(want): if isinstance(v, dict): for key, value in iteritems(v): - if value is None: + if value is None and k in have and key in have.get(k): dict_val = have.get(k).get(key) test_key_dict.update({key: dict_val}) test_dict.update({k: test_key_dict}) if isinstance(v, list) and isinstance(v[0], dict): for key, value in iteritems(v[0]): - if value is None: + if value is None and k in have and key in have.get(k): dict_val = have.get(k).get(key) test_key_dict.update({key: dict_val}) test_dict.update({k: test_key_dict}) diff --git a/plugins/modules/iosxr_banner.py b/plugins/modules/iosxr_banner.py index d82bb3b8..d57b0b65 100644 --- a/plugins/modules/iosxr_banner.py +++ b/plugins/modules/iosxr_banner.py @@ -33,17 +33,20 @@ description: - Specifies the type of banner to configure on remote device. required: true + type: str choices: - login - motd text: description: - - Banner text to be configured. Accepts multiline string, without empty lines. + - Banner text to be configured. Accepts multi line string, without empty lines. Requires I(state=present). + type: str state: description: - Existential state of the configuration on the device. default: present + type: str choices: - present - absent @@ -84,7 +87,6 @@ description: NetConf rpc xml sent to device with transport C(netconf) returned: always (empty list when no xml rpc to send) type: list - version_added: 2.5 sample: - ' diff --git a/plugins/modules/iosxr_bgp.py b/plugins/modules/iosxr_bgp.py index 81697c1e..7f453ab6 100644 --- a/plugins/modules/iosxr_bgp.py +++ b/plugins/modules/iosxr_bgp.py @@ -25,6 +25,7 @@ config: description: - Specifies the BGP related configuration. + type: dict suboptions: bgp_as: description: @@ -34,7 +35,7 @@ router_id: description: - Configures the BGP routing process router-id value. - default: + type: str log_neighbor_changes: description: - Enable/disable logging neighbor up/down and reset reason. @@ -42,10 +43,13 @@ neighbors: description: - Specifies BGP neighbor related configurations. + type: list + elements: dict suboptions: neighbor: description: - Neighbor router address. + type: str required: true remote_as: description: @@ -55,9 +59,11 @@ update_source: description: - Source of the routing updates. + type: str password: description: - Password to authenticate the BGP peer connection. + type: str enabled: description: - Administratively shutdown or enable a neighbor. @@ -65,6 +71,7 @@ description: description: - Neighbor specific description. + type: str advertisement_interval: description: - Specifies the minimum interval (in seconds) between sending BGP routing @@ -85,6 +92,7 @@ timers: description: - Specifies BGP neighbor timer related configurations. + type: dict suboptions: keepalive: description: @@ -92,14 +100,12 @@ to its peer. - The range is from 0 to 65535. type: int - required: true holdtime: description: - Interval after not receiving a keepalive message that the software declares a peer dead. - The range is from 3 to 65535. type: int - required: true min_neighbor_holdtime: description: - Interval specifying the minimum acceptable hold-time from a BGP @@ -111,6 +117,8 @@ address_family: description: - Specifies BGP address family related configurations. + type: list + elements: dict suboptions: afi: description: @@ -119,6 +127,7 @@ - ipv4 - ipv6 required: true + type: str safi: description: - Specifies the type of cast for the address family. @@ -127,53 +136,68 @@ - unicast - multicast - labeled-unicast + type: str default: unicast redistribute: description: - Specifies the redistribute information from another routing protocol. + type: list + elements: dict suboptions: protocol: description: - Specifies the protocol for configuring redistribute information. + type: str choices: - - ospf - - ospfv3 - - eigrp - - isis - - static - - connected - - lisp - - mobile - - rip - - subscriber + - ospf + - ospfv3 + - eigrp + - isis + - static + - connected + - lisp + - mobile + - rip + - subscriber required: true id: description: - Identifier for the routing protocol for configuring redistribute information. - Valid for protocols 'ospf', 'eigrp', 'isis' and 'ospfv3'. + type: str metric: description: - Specifies the metric for redistributed routes. + type: int route_map: description: - Specifies the route map reference. + type: str networks: description: - Specify networks to announce via BGP. - For operation replace, this option is mutually exclusive with root level networks option. + type: list + elements: dict suboptions: network: description: - Network ID to announce via BGP. required: true + aliases: + - prefix + type: str masklen: description: - Subnet mask length for the network to announce(e.g, 8, 16, 24, etc.). + type: int + required: true route_map: description: - Route map to modify the attributes. + type: str operation: description: - Specifies the operation to be performed on the BGP process configured on the @@ -187,6 +211,7 @@ the device and replaced with the input configuration. - In case of delete the existing BGP configuration will be removed from the device. default: merge + type: str choices: - merge - replace @@ -245,22 +270,34 @@ from ansible_collections.cisco.iosxr.plugins.module_utils.network.iosxr.providers.module import ( NetworkModule, ) -from ansible_collections.cisco.iosxr.plugins.module_utils.network.iosxr.providers.cli.config.bgp.process import ( - REDISTRIBUTE_PROTOCOLS, -) def main(): """ main entry point for module execution """ network_spec = { - "prefix": dict(required=True), + "network": dict(aliases=["prefix"], required=True), "masklen": dict(type="int", required=True), "route_map": dict(), } redistribute_spec = { - "protocol": dict(choices=REDISTRIBUTE_PROTOCOLS, required=True), + "protocol": dict( + type="str", + choices=[ + "ospf", + "ospfv3", + "eigrp", + "isis", + "static", + "connected", + "lisp", + "mobile", + "rip", + "subscriber", + ], + required=True, + ), "id": dict(), "metric": dict(type="int"), "route_map": dict(), diff --git a/plugins/modules/iosxr_command.py b/plugins/modules/iosxr_command.py index d444d53a..68e990b1 100644 --- a/plugins/modules/iosxr_command.py +++ b/plugins/modules/iosxr_command.py @@ -7,7 +7,6 @@ __metaclass__ = type - DOCUMENTATION = """ module: iosxr_command author: Ricardo Carrillo Cruz (@rcarrillocruz) @@ -34,6 +33,11 @@ The resulting output from the command is returned. If the I(wait_for) argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired. + - If a command sent to the device requires answering a prompt, it is possible to pass + a dict containing command, answer and prompt. Common answers are 'y' or "\\r" + (carriage return, must be double quotes). See examples + type: list + elements: raw required: true wait_for: description: @@ -42,6 +46,8 @@ is not true within the configured number of retries, the task fails. See examples. aliases: - waitfor + type: list + elements: str match: description: - The I(match) argument is used in conjunction with the I(wait_for) argument to @@ -52,18 +58,21 @@ choices: - any - all + type: str retries: description: - Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the I(wait_for) conditions. default: 10 + type: int interval: description: - Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. default: 1 + type: int """ EXAMPLES = """ @@ -124,9 +133,6 @@ run_commands, iosxr_argument_spec, ) -from ansible_collections.cisco.iosxr.plugins.module_utils.network.iosxr.iosxr import ( - command_spec, -) def parse_commands(module, warnings): @@ -148,15 +154,14 @@ def parse_commands(module, warnings): def main(): argument_spec = dict( - commands=dict(type="list", required=True), - wait_for=dict(type="list", aliases=["waitfor"]), + commands=dict(type="list", required=True, elements="raw"), + wait_for=dict(type="list", aliases=["waitfor"], elements="str"), match=dict(default="all", choices=["all", "any"]), retries=dict(default=10, type="int"), interval=dict(default=1, type="int"), ) argument_spec.update(iosxr_argument_spec) - argument_spec.update(command_spec) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True diff --git a/plugins/modules/iosxr_config.py b/plugins/modules/iosxr_config.py index 61642e89..8453d8d9 100644 --- a/plugins/modules/iosxr_config.py +++ b/plugins/modules/iosxr_config.py @@ -34,6 +34,8 @@ must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser. + type: list + elements: str aliases: - commands parents: @@ -41,23 +43,30 @@ - The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands. + type: list + elements: str src: description: - Specifies the source path to the file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with I(lines), I(parents). + type: path before: description: - The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system. + type: list + elements: str after: description: - The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with I(before) this allows the playbook designer to append a set of commands to be executed after the command set. + type: list + elements: str match: description: - Instructs the module on the way to perform the matching of the set of commands @@ -67,6 +76,7 @@ an equal match. Finally, if match is set to I(none), the module will not attempt to compare the source configuration with the running configuration on the remote device. + type: str default: line choices: - line @@ -80,6 +90,7 @@ the device in configuration mode. If the replace argument is set to I(block) then the entire command block is pushed to the device in configuration mode if any line is not correct. + type: str default: line choices: - line @@ -102,6 +113,7 @@ are times when it is not desirable to have the task get the current running-config for every task in a playbook. The I(config) argument allows the implementer to pass in the configuration to use as the base config for comparison. + type: str backup: description: - This argument will cause the module to create a full backup of the current C(running-config) @@ -116,6 +128,7 @@ - Allows a commit description to be specified to be included when the configuration is committed. If the configuration is not changed or committed, this argument is ignored. + type: str default: configured by iosxr_config admin: description: @@ -129,6 +142,7 @@ is committed. A valid label must begin with an alphabet and not exceed 30 characters, only alphabets, digits, hyphens and underscores are allowed. If the configuration is not changed or committed, this argument is ignored. + type: str backup_options: description: - This is a dict object containing configurable options related to backup file @@ -140,6 +154,7 @@ - The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by _config.@ + type: str dir_path: description: - This option provides the path ending with directory name in which the backup @@ -391,10 +406,10 @@ def main(): backup_spec = dict(filename=dict(), dir_path=dict(type="path")) argument_spec = dict( src=dict(type="path"), - lines=dict(aliases=["commands"], type="list"), - parents=dict(type="list"), - before=dict(type="list"), - after=dict(type="list"), + lines=dict(aliases=["commands"], type="list", elements="str"), + parents=dict(type="list", elements="str"), + before=dict(type="list", elements="str"), + after=dict(type="list", elements="str"), match=dict( default="line", choices=["line", "strict", "exact", "none"] ), diff --git a/plugins/modules/iosxr_facts.py b/plugins/modules/iosxr_facts.py index 71aaa6b4..5ac8effa 100644 --- a/plugins/modules/iosxr_facts.py +++ b/plugins/modules/iosxr_facts.py @@ -38,6 +38,8 @@ with an initial C(M(!)) to specify that a specific subset should not be collected. required: false default: '!config' + type: list + elements: str gather_network_resources: description: - When supplied, this argument will restrict the facts collected to a given subset. @@ -48,6 +50,8 @@ 'lldp_interfaces', 'interfaces', 'l2_interfaces', 'l3_interfaces', 'lag_interfaces', 'acls', 'acl_interfaces', 'static_routes', 'ospfv2'. required: false + type: list + elements: str """ EXAMPLES = """ diff --git a/plugins/modules/iosxr_interface.py b/plugins/modules/iosxr_interface.py index a50c69dd..d3dca6e9 100644 --- a/plugins/modules/iosxr_interface.py +++ b/plugins/modules/iosxr_interface.py @@ -38,10 +38,12 @@ name: description: - Name of the interface to configure in C(type + path) format. e.g. C(GigabitEthernet0/0/0/0) + type: str required: true description: description: - Description of Interface being configured. + type: str enabled: description: - Removes the shutdown configuration, which removes the forced administrative @@ -54,6 +56,7 @@ you to configure modular services cards before they are inserted into the router. When the cards are inserted, they are instantly configured. Active cards are the ones already inserted. + type: str choices: - active - preconfigure @@ -65,12 +68,15 @@ - '10' - '100' - '1000' + type: str mtu: description: - Sets the MTU value for the interface. Range is between 64 and 65535' + type: str duplex: description: - Configures the interface duplex mode. Default is auto-negotiation when not configured. + type: str choices: - full - half @@ -79,25 +85,100 @@ - Transmit rate in bits per second (bps). - This is state check parameter only. - Supports conditionals, see L(Conditionals in Networking Modules,../network/user_guide/network_working_with_command_output.html) + type: str rx_rate: description: - Receiver rate in bits per second (bps). - This is state check parameter only. - Supports conditionals, see L(Conditionals in Networking Modules,../network/user_guide/network_working_with_command_output.html) - aggregate: - description: - - List of Interface definitions. Include multiple interface configurations together, - one each on a separate line + type: str delay: description: - Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are I(state) with values C(up)/C(down), I(tx_rate) and I(rx_rate). default: 10 + type: int + aggregate: + description: List of interfaces definition + type: list + elements: dict + suboptions: + name: + description: + - Name of the interface to configure in C(type + path) format. e.g. C(GigabitEthernet0/0/0/0) + type: str + description: + description: + - Description of Interface being configured. + type: str + enabled: + description: + - Removes the shutdown configuration, which removes the forced administrative + down on the interface, enabling it to move to an up or down state. + type: bool + active: + description: + - Whether the interface is C(active) or C(preconfigured). Preconfiguration allows + you to configure modular services cards before they are inserted into the router. + When the cards are inserted, they are instantly configured. Active cards are + the ones already inserted. + type: str + choices: + - active + - preconfigure + speed: + description: + - Configure the speed for an interface. Default is auto-negotiation when not configured. + choices: + - '10' + - '100' + - '1000' + type: str + mtu: + description: + - Sets the MTU value for the interface. Range is between 64 and 65535' + type: str + duplex: + description: + - Configures the interface duplex mode. Default is auto-negotiation when not configured. + type: str + choices: + - full + - half + tx_rate: + description: + - Transmit rate in bits per second (bps). + - This is state check parameter only. + - Supports conditionals, see L(Conditionals in Networking Modules,../network/user_guide/network_working_with_command_output.html) + type: str + rx_rate: + description: + - Receiver rate in bits per second (bps). + - This is state check parameter only. + - Supports conditionals, see L(Conditionals in Networking Modules,../network/user_guide/network_working_with_command_output.html) + type: str + delay: + description: + - Time in seconds to wait before checking for the operational state on remote + device. This wait is applicable for operational state argument which are I(state) + with values C(up)/C(down), I(tx_rate) and I(rx_rate). + type: int + state: + description: + - State of the Interface configuration, C(up) means present and operationally + up and C(down) means present and operationally C(down) + type: str + choices: + - present + - absent + - up + - down state: description: - State of the Interface configuration, C(up) means present and operationally up and C(down) means present and operationally C(down) + type: str default: present choices: - present @@ -188,7 +269,6 @@ description: NetConf rpc xml sent to device with transport C(netconf) returned: always (empty list when no xml rpc to send) type: list - version_added: 2.5 sample: - ' @@ -921,7 +1001,7 @@ def main(): duplex=dict(choices=["full", "half"]), enabled=dict(default=True, type="bool"), active=dict( - default="active", type="str", choices=["active", "preconfigure"] + type="str", choices=["active", "preconfigure"], default="active" ), tx_rate=dict(), rx_rate=dict(), diff --git a/plugins/modules/iosxr_l2_interfaces.py b/plugins/modules/iosxr_l2_interfaces.py index 27334372..c92104d9 100644 --- a/plugins/modules/iosxr_l2_interfaces.py +++ b/plugins/modules/iosxr_l2_interfaces.py @@ -60,6 +60,7 @@ - Configures Layer 2 protocol tunneling and protocol data unit (PDU) filtering on an interface. type: list + elements: dict suboptions: cdp: description: @@ -102,6 +103,7 @@ valid only with respect to Sub-Interface and is not valid when configuring for Interface. type: list + elements: int propagate: description: - Propagate Layer 2 transport events. Note that it will work only when the diff --git a/plugins/modules/iosxr_l3_interfaces.py b/plugins/modules/iosxr_l3_interfaces.py index e00f0ec7..07af8314 100644 --- a/plugins/modules/iosxr_l3_interfaces.py +++ b/plugins/modules/iosxr_l3_interfaces.py @@ -60,6 +60,7 @@ - The address format is /, the mask is number in range 0-32 eg. 192.168.0.1/24 type: list + elements: dict suboptions: address: description: @@ -75,6 +76,7 @@ - The address format is /, the mask is number in range 0-128 eg. fd5d:12c9:2201:1::1/64 type: list + elements: dict suboptions: address: description: diff --git a/plugins/modules/iosxr_lacp_interfaces.py b/plugins/modules/iosxr_lacp_interfaces.py index 5e2ab939..dc156891 100644 --- a/plugins/modules/iosxr_lacp_interfaces.py +++ b/plugins/modules/iosxr_lacp_interfaces.py @@ -46,6 +46,7 @@ config: description: A dictionary of LACP interfaces options. type: list + elements: dict suboptions: name: description: diff --git a/plugins/modules/iosxr_lag_interfaces.py b/plugins/modules/iosxr_lag_interfaces.py index 2f91c2f3..201365e8 100644 --- a/plugins/modules/iosxr_lag_interfaces.py +++ b/plugins/modules/iosxr_lag_interfaces.py @@ -29,8 +29,6 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type - - DOCUMENTATION = """ module: iosxr_lag_interfaces short_description: LAG interfaces resource module @@ -49,69 +47,58 @@ suboptions: name: description: - - Name/Identifier of the LAG/Ether-Bundle to configure. + - Name/Identifier of the LAG/Ether-Bundle to configure. type: str required: true members: description: - - List of member interfaces for the LAG/Ether-Bundle. + - List of member interfaces for the LAG/Ether-Bundle. type: list elements: dict suboptions: member: description: - - Name of the member interface. + - Name of the member interface. type: str mode: description: - - Specifies the mode of the operation for the member interface. - - Mode 'active' runs LACP in active mode. - - Mode 'on' does not run LACP over the port. - - Mode 'passive' runs LACP in passive mode over the port. - - Mode 'inherit' runs LACP as configured in the bundle. - choices: - - on - - active - - passive - - inherit + - Specifies the mode of the operation for the member interface. + - Mode 'active' runs LACP in active mode. + - Mode 'on' does not run LACP over the port. + - Mode 'passive' runs LACP in passive mode over the port. + - Mode 'inherit' runs LACP as configured in the bundle. type: str + choices: ["on", "active", "passive", "inherit"] mode: description: - - LAG mode. - - Mode 'active' runs LACP in active mode over the port. - - Mode 'on' does not run LACP over the port. - - Mode 'passive' runs LACP in passive mode over the port. - choices: - - on - - active - - passive + - LAG mode. + - Mode 'active' runs LACP in active mode over the port. + - Mode 'on' does not run LACP over the port. + - Mode 'passive' runs LACP in passive mode over the port. type: str + choices: ["on", "active", "passive"] links: description: - - This dict contains configurable options related to LAG/Ether-Bundle links. + - This dict contains configurable options related to LAG/Ether-Bundle links. type: dict suboptions: max_active: description: - - Specifies the limit on the number of links that can be active in the - LAG/Ether-Bundle. - - Refer to vendor documentation for valid values. + - Specifies the limit on the number of links that can be active in the LAG/Ether-Bundle. + - Refer to vendor documentation for valid values. type: int min_active: description: - - Specifies the minimum number of active links needed to bring up the - LAG/Ether-Bundle. - - Refer to vendor documentation for valid values. + - Specifies the minimum number of active links needed to bring up the LAG/Ether-Bundle. + - Refer to vendor documentation for valid values. type: int load_balancing_hash: description: - - Specifies the hash function used for traffic forwarded over the LAG/Ether-Bundle. - - Option 'dst-ip' uses the destination IP as the hash function. - - Option 'src-ip' uses the source IP as the hash function. + - Specifies the hash function used for traffic forwarded over the LAG/Ether-Bundle. + - Option 'dst-ip' uses the destination IP as the hash function. + - Option 'src-ip' uses the source IP as the hash function. type: str - choices: - - dst-ip - - src-ip + choices: ["dst-ip", "src-ip"] running_config: description: - This option is used only with state I(parsed). @@ -123,16 +110,16 @@ type: str state: description: - - The state of the configuration after module completion. + - The state of the configuration after module completion. type: str choices: - - merged - - replaced - - overridden - - deleted - - parsed - - rendered - - gathered + - merged + - replaced + - overridden + - deleted + - parsed + - rendered + - gathered default: merged """ diff --git a/plugins/modules/iosxr_logging.py b/plugins/modules/iosxr_logging.py index 6d87ced8..bb6bf2e1 100644 --- a/plugins/modules/iosxr_logging.py +++ b/plugins/modules/iosxr_logging.py @@ -37,14 +37,17 @@ - monitor - buffered - file + type: str name: description: - When C(dest) = I(file) name indicates file-name - When C(dest) = I(host) name indicates the host-name or ip-address of syslog server. + type: str vrf: description: - vrf name when syslog server is configured, C(dest) = C(host) + type: str default: default size: description: @@ -52,23 +55,82 @@ I(307200 to 125000000 bytes). Default 307200 - Size of file when C(dest) = C(file). The acceptable value is in the range I(1 to 2097152)KB. Default 2 GB + type: int facility: description: - To configure the type of syslog facility in which system logging (syslog) messages are sent to syslog servers Optional config for C(dest) = C(host) default: local7 + type: str hostnameprefix: description: - To append a hostname prefix to system logging (syslog) messages logged to syslog servers. Optional config for C(dest) = C(host) + type: str level: description: - Specifies the severity level for the logging. + type: str default: debugging aliases: - severity + choices: ["emergencies", "alerts", "critical", "errors", "warning", "notifications", "informational", "debugging"] aggregate: description: List of syslog logging configuration definitions. + type: list + elements: dict + suboptions: + dest: + description: + - Destination for system logging (syslog) messages. + choices: + - host + - console + - monitor + - buffered + - file + type: str + name: + description: + - When C(dest) = I(file) name indicates file-name + - When C(dest) = I(host) name indicates the host-name or ip-address of syslog + server. + type: str + vrf: + description: + - vrf name when syslog server is configured, C(dest) = C(host) + type: str + size: + description: + - Size of buffer when C(dest) = C(buffered). The acceptable value is in the range + I(307200 to 125000000 bytes). Default 307200 + - Size of file when C(dest) = C(file). The acceptable value is in the range I(1 + to 2097152)KB. Default 2 GB + type: int + facility: + description: + - To configure the type of syslog facility in which system logging (syslog) messages + are sent to syslog servers Optional config for C(dest) = C(host) + type: str + hostnameprefix: + description: + - To append a hostname prefix to system logging (syslog) messages logged to syslog + servers. Optional config for C(dest) = C(host) + type: str + level: + description: + - Specifies the severity level for the logging. + type: str + aliases: + - severity + choices: ["emergencies", "alerts", "critical", "errors", "warning", "notifications", "informational", "debugging"] + state: + description: + - Existential state of the logging configuration on the node. + choices: + - present + - absent + type: str state: description: - Existential state of the logging configuration on the node. @@ -76,6 +138,7 @@ choices: - present - absent + type: str extends_documentation_fragment: - cisco.iosxr.iosxr """ @@ -159,7 +222,6 @@ description: NetConf rpc xml sent to device with transport C(netconf) returned: always (empty list when no xml rpc to send) type: list - version_added: 2.5 sample: - ' @@ -1089,7 +1151,7 @@ def main(): hostnameprefix=dict(type="str"), level=dict( type="str", - default="informational", + default="debugging", aliases=["severity"], choices=[ "emergencies", diff --git a/plugins/modules/iosxr_netconf.py b/plugins/modules/iosxr_netconf.py index c8f42134..a075958f 100644 --- a/plugins/modules/iosxr_netconf.py +++ b/plugins/modules/iosxr_netconf.py @@ -27,6 +27,7 @@ - This argument specifies the port the netconf service should listen on for SSH connections. The default port as defined in RFC 6242 is 830. required: false + type: int default: 830 aliases: - listens_on @@ -34,6 +35,7 @@ description: - netconf vrf name required: false + type: str default: default aliases: - vrf @@ -43,6 +45,7 @@ the I(state) argument is set to I(present) the netconf service will be configured. If the I(state) argument is set to I(absent) the netconf service will be removed from the configuration. + type: str required: false default: present choices: diff --git a/plugins/modules/iosxr_ospfv2.py b/plugins/modules/iosxr_ospfv2.py index 31ccbe49..660387bb 100644 --- a/plugins/modules/iosxr_ospfv2.py +++ b/plugins/modules/iosxr_ospfv2.py @@ -178,23 +178,22 @@ description: Configure BFD parameters type: dict suboptions: - fast_detect: - description: Configure fast detection - type: dict - suboptions: - set: - description: Enable fast detection only - type: bool - strict_mode: - description: Hold down neighbor session until BFD session is - up - type: bool - minimum_interval: - description: Hello interval in milli-seconds - type: int - multiplier: - description: Detect multiplier - type: int + fast_detect: + description: Configure fast detection + type: dict + suboptions: + set: + description: Enable fast detection only + type: bool + strict_mode: + description: Hold down neighbor session until BFD session is up + type: bool + minimum_interval: + description: Hello interval in milli-seconds + type: int + multiplier: + description: Detect multiplier + type: int nssa: description: - NSSA settings for the area diff --git a/plugins/modules/iosxr_system.py b/plugins/modules/iosxr_system.py index d608a909..4e9ccc6f 100644 --- a/plugins/modules/iosxr_system.py +++ b/plugins/modules/iosxr_system.py @@ -34,35 +34,45 @@ hostname: description: - Configure the device hostname parameter. This option takes an ASCII string value. + type: str vrf: description: - VRF name for domain services + type: str + default: "default" domain_name: description: - Configure the IP domain name on the remote device to the provided value. Value should be in the dotted name form and will be appended to the C(hostname) to create a fully-qualified domain name. + type: str domain_search: description: - Provides the list of domain suffixes to append to the hostname for the purpose of doing name resolution. This argument accepts a list of names and will be reconciled with the current active configuration on the running node. + type: list + elements: str lookup_source: description: - The C(lookup_source) argument provides one or more source interfaces to use for performing DNS lookups. The interface provided in C(lookup_source) must be a valid interface configured on the device. + type: str lookup_enabled: description: - Provides administrative control for enabling or disabling DNS lookups. When this argument is set to True, lookups are performed and when it is set to False, lookups are not performed. type: bool + default: true name_servers: description: - The C(name_serves) argument accepts a list of DNS name servers by way of either FQDN or IP address to use to perform name resolution lookups. This argument accepts wither a list of DNS servers See examples. + type: list + elements: str state: description: - State of the configuration values in the device's current active configuration. When @@ -72,6 +82,7 @@ choices: - present - absent + type: str """ EXAMPLES = """ @@ -124,7 +135,6 @@ description: NetConf rpc xml sent to device with transport C(netconf) returned: always (empty list when no xml rpc to send) type: list - version_added: 2.5 sample: - ' @@ -898,12 +908,12 @@ def main(): """ Main entry point for Ansible module execution """ argument_spec = dict( - hostname=dict(), + hostname=dict(type="str"), vrf=dict(type="str", default="default"), - domain_name=dict(), - domain_search=dict(type="list"), - name_servers=dict(type="list"), - lookup_source=dict(), + domain_name=dict(type="str"), + domain_search=dict(type="list", elements="str"), + name_servers=dict(type="list", elements="str"), + lookup_source=dict(type="str"), lookup_enabled=dict(type="bool", default=True), state=dict(choices=["present", "absent"], default="present"), ) diff --git a/plugins/modules/iosxr_user.py b/plugins/modules/iosxr_user.py index d0e5bc89..e1c39905 100644 --- a/plugins/modules/iosxr_user.py +++ b/plugins/modules/iosxr_user.py @@ -37,11 +37,90 @@ aliases: - users - collection + type: list + elements: dict + suboptions: + name: + description: + - The username to be configured on the Cisco IOS XR device. This argument accepts + a string value and is mutually exclusive with the C(aggregate) argument. Please + note that this option is not same as C(provider username). + type: str + required: true + configured_password: + description: + - The password to be configured on the Cisco IOS XR device. The password needs + to be provided in clear text. Password is encrypted on the device when used + with I(cli) and by Ansible when used with I(netconf) using the same MD5 hash + technique with salt size of 3. Please note that this option is not same as C(provider + password). + type: str + update_password: + description: + - Since passwords are encrypted in the device running config, this argument will + instruct the module when to change the password. When set to C(always), the + password will always be updated in the device and when set to C(on_create) the + password will be updated only if the username is created. + type: str + choices: + - on_create + - always + group: + description: + - Configures the group for the username in the device running configuration. The + argument accepts a string value defining the group name. This argument does + not check if the group has been configured on the device. + type: str + aliases: + - role + groups: + description: + - Configures the groups for the username in the device running configuration. + The argument accepts a list of group names. This argument does not check if + the group has been configured on the device. It is similar to the aggregate + command for usernames, but lets you configure multiple groups for the user(s). + type: list + elements: str + admin: + description: + - Enters into administration configuration mode for making config changes to the + device. + - Applicable only when using network_cli transport + type: bool + state: + description: + - Configures the state of the username definition as it relates to the device + operational configuration. When set to I(present), the username(s) should be + configured in the device active configuration and when set to I(absent) the + username(s) should not be in the device active configuration + type: str + choices: + - present + - absent + public_key: + description: + - Configures the contents of the public keyfile to upload to the IOS-XR node. + This enables users to login using the accompanying private key. IOS-XR only + accepts base64 decoded files, so this will be decoded and uploaded to the node. + Do note that this requires an OpenSSL public key file, PuTTy generated files + will not work! Mutually exclusive with public_key_contents. If used with multiple + users in aggregates, then the same key file is used for all users. + type: str + public_key_contents: + description: + - Configures the contents of the public keyfile to upload to the IOS-XR node. + This enables users to login using the accompanying private key. IOS-XR only + accepts base64 decoded files, so this will be decoded and uploaded to the node. + Do note that this requires an OpenSSL public key file, PuTTy generated files + will not work! Mutually exclusive with public_key.If used with multiple users + in aggregates, then the same key file is used for all users. + type: str name: description: - The username to be configured on the Cisco IOS XR device. This argument accepts a string value and is mutually exclusive with the C(aggregate) argument. Please note that this option is not same as C(provider username). + type: str configured_password: description: - The password to be configured on the Cisco IOS XR device. The password needs @@ -49,12 +128,14 @@ with I(cli) and by Ansible when used with I(netconf) using the same MD5 hash technique with salt size of 3. Please note that this option is not same as C(provider password). + type: str update_password: description: - Since passwords are encrypted in the device running config, this argument will instruct the module when to change the password. When set to C(always), the password will always be updated in the device and when set to C(on_create) the password will be updated only if the username is created. + type: str default: always choices: - on_create @@ -64,6 +145,7 @@ - Configures the group for the username in the device running configuration. The argument accepts a string value defining the group name. This argument does not check if the group has been configured on the device. + type: str aliases: - role groups: @@ -72,6 +154,8 @@ The argument accepts a list of group names. This argument does not check if the group has been configured on the device. It is similar to the aggregate command for usernames, but lets you configure multiple groups for the user(s). + type: list + elements: str purge: description: - Instructs the module to consider the resource definition absolute. It will remove @@ -92,6 +176,7 @@ operational configuration. When set to I(present), the username(s) should be configured in the device active configuration and when set to I(absent) the username(s) should not be in the device active configuration + type: str default: present choices: - present @@ -104,6 +189,7 @@ Do note that this requires an OpenSSL public key file, PuTTy generated files will not work! Mutually exclusive with public_key_contents. If used with multiple users in aggregates, then the same key file is used for all users. + type: str public_key_contents: description: - Configures the contents of the public keyfile to upload to the IOS-XR node. @@ -112,6 +198,8 @@ Do note that this requires an OpenSSL public key file, PuTTy generated files will not work! Mutually exclusive with public_key.If used with multiple users in aggregates, then the same key file is used for all users. + type: str + requirements: - ncclient >= 0.5.3 when using netconf - lxml >= 4.1.1 when using netconf @@ -175,7 +263,6 @@ description: NetConf rpc xml sent to device with transport C(netconf) returned: always (empty list when no xml rpc to send) type: list - version_added: 2.5 sample: - ' @@ -804,17 +891,19 @@ def main(): """ main entry point for module execution """ element_spec = dict( - name=dict(), - configured_password=dict(no_log=True), + name=dict(type="str"), + configured_password=dict(type="str", no_log=True), update_password=dict( - default="always", choices=["on_create", "always"] + type="str", default="always", choices=["on_create", "always"] ), admin=dict(type="bool", default=False), - public_key=dict(), - public_key_contents=dict(), - group=dict(aliases=["role"]), - groups=dict(type="list", elements="dict"), - state=dict(default="present", choices=["present", "absent"]), + public_key=dict(type="str"), + public_key_contents=dict(type="str"), + group=dict(type="str", aliases=["role"]), + groups=dict(type="list", elements="str"), + state=dict( + type="str", default="present", choices=["present", "absent"] + ), ) aggregate_spec = deepcopy(element_spec) aggregate_spec["name"] = dict(required=True) @@ -834,7 +923,6 @@ def main(): elements="dict", options=aggregate_spec, aliases=["users", "collection"], - mutually_exclusive=mutually_exclusive, ), purge=dict(type="bool", default=False), ) diff --git a/plugins/netconf/iosxr.py b/plugins/netconf/iosxr.py index 724f4362..3eca92df 100644 --- a/plugins/netconf/iosxr.py +++ b/plugins/netconf/iosxr.py @@ -147,8 +147,8 @@ def get_capabilities(self): result["rpc"] = self.get_base_rpc() result["network_api"] = "netconf" result["device_info"] = self.get_device_info() - result["server_capabilities"] = [c for c in self.m.server_capabilities] - result["client_capabilities"] = [c for c in self.m.client_capabilities] + result["server_capabilities"] = list(self.m.server_capabilities) + result["client_capabilities"] = list(self.m.client_capabilities) result["session_id"] = self.m.session_id result["device_operations"] = self.get_device_operations( result["server_capabilities"] diff --git a/tests/integration/targets/iosxr_config/templates/basic/configuration.j2 b/tests/integration/targets/iosxr_config/templates/basic/configuration.j2 new file mode 100644 index 00000000..73c98879 --- /dev/null +++ b/tests/integration/targets/iosxr_config/templates/basic/configuration.j2 @@ -0,0 +1,3 @@ +interface Loopback888 + description test for ansible automation + shutdown diff --git a/tests/integration/targets/iosxr_config/tests/redirection/shortname.yaml b/tests/integration/targets/iosxr_config/tests/redirection/shortname.yaml index 337140ae..d1c67fe2 100644 --- a/tests/integration/targets/iosxr_config/tests/redirection/shortname.yaml +++ b/tests/integration/targets/iosxr_config/tests/redirection/shortname.yaml @@ -4,13 +4,13 @@ - name: Use src with module alias register: result cisco.iosxr.config: - src: basic/config.j2 + src: basic/configuration.j2 - assert: that: # make sure that the template content was read and not the path - result.changed == true - - result.updates is defined + - '"description test for ansible automation" in result.diff["prepared"]' - name: use module alias to take configuration backup register: result diff --git a/tests/integration/targets/iosxr_logging/tests/cli/net_logging.yaml b/tests/integration/targets/iosxr_logging/tests/cli/net_logging.yaml index 85ea66c1..94d057b4 100644 --- a/tests/integration/targets/iosxr_logging/tests/cli/net_logging.yaml +++ b/tests/integration/targets/iosxr_logging/tests/cli/net_logging.yaml @@ -20,7 +20,7 @@ - assert: that: - result.changed == true - - '"logging 172.16.0.1 vrf default severity info" in result.commands' + - '"logging 172.16.0.1 vrf default severity debugging" in result.commands' - name: Remove host logging - teardown ansible.netcommon.net_logging: diff --git a/tests/integration/targets/iosxr_logging/tests/netconf/basic.yaml b/tests/integration/targets/iosxr_logging/tests/netconf/basic.yaml index 7cbd3144..57bc6de9 100644 --- a/tests/integration/targets/iosxr_logging/tests/netconf/basic.yaml +++ b/tests/integration/targets/iosxr_logging/tests/netconf/basic.yaml @@ -172,7 +172,7 @@ - '"notice" in result.xml[2]' - '"alert" in result.xml[3]' - '"4700000" in result.xml[4]' - - '"info" in result.xml[5]' + - '"debug" in result.xml[5]' - '"local3" in result.xml[6]' - '"host3" in result.xml[7]' @@ -222,6 +222,6 @@ - '"notice" in result.xml[2]' - '"alert" in result.xml[3]' - '"4700000" in result.xml[4]' - - '"info" in result.xml[5]' + - '"debug" in result.xml[5]' - '"local3" in result.xml[6]' - '"host3" in result.xml[7]' diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt new file mode 100644 index 00000000..195b00f6 --- /dev/null +++ b/tests/sanity/ignore-2.10.txt @@ -0,0 +1 @@ +plugins/action/iosxr.py action-plugin-docs # base class for deprecated network platform modules using `connection: local diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 442d692c..89a6aac5 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,56 +1,3 @@ -plugins/modules/iosxr_banner.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_banner.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_banner.py validate-modules:doc-missing-type -plugins/modules/iosxr_banner.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_banner.py validate-modules:undocumented-parameter -plugins/modules/iosxr_bgp.py validate-modules:doc-missing-type -plugins/modules/iosxr_bgp.py validate-modules:nonexistent-parameter-documented -plugins/modules/iosxr_bgp.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_bgp.py validate-modules:undocumented-parameter -plugins/modules/iosxr_lag_interfaces.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_interface.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_interface.py validate-modules:deprecation-mismatch -plugins/modules/iosxr_interface.py validate-modules:doc-missing-type -plugins/modules/iosxr_interface.py validate-modules:missing-suboption-docs -plugins/modules/iosxr_interface.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_interface.py validate-modules:undocumented-parameter -plugins/modules/iosxr_interface.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_interface.py validate-modules:invalid-documentation -plugins/modules/iosxr_ospfv2.py validate-modules:invalid-documentation -plugins/modules/iosxr_command.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_command.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_command.py validate-modules:doc-missing-type -plugins/modules/iosxr_command.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_command.py validate-modules:undocumented-parameter -plugins/modules/iosxr_config.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_config.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_config.py validate-modules:doc-missing-type -plugins/modules/iosxr_config.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_config.py validate-modules:undocumented-parameter -plugins/modules/iosxr_facts.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_facts.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_facts.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_facts.py validate-modules:undocumented-parameter -plugins/modules/iosxr_logging.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_logging.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_logging.py validate-modules:doc-missing-type -plugins/modules/iosxr_logging.py validate-modules:missing-suboption-docs -plugins/modules/iosxr_logging.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_logging.py validate-modules:undocumented-parameter -plugins/modules/iosxr_netconf.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_netconf.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_netconf.py validate-modules:doc-missing-type -plugins/modules/iosxr_netconf.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_netconf.py validate-modules:undocumented-parameter -plugins/modules/iosxr_system.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_system.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_system.py validate-modules:doc-missing-type -plugins/modules/iosxr_system.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_system.py validate-modules:undocumented-parameter -plugins/modules/iosxr_user.py validate-modules:doc-choices-do-not-match-spec -plugins/modules/iosxr_user.py validate-modules:doc-default-does-not-match-spec -plugins/modules/iosxr_user.py validate-modules:doc-missing-type -plugins/modules/iosxr_user.py validate-modules:missing-suboption-docs -plugins/modules/iosxr_user.py validate-modules:parameter-type-not-in-doc -plugins/modules/iosxr_user.py validate-modules:undocumented-parameter -plugins/action/iosxr.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` +plugins/action/iosxr.py action-plugin-docs # base class for deprecated network platform modules using `connection: local +plugins/modules/iosxr_interface.py validate-modules:deprecation-mismatch # 2.9 expects METADATA +plugins/modules/iosxr_interface.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict diff --git a/tests/unit/compat/mock.py b/tests/unit/compat/mock.py index b45d6b5c..8d265c65 100644 --- a/tests/unit/compat/mock.py +++ b/tests/unit/compat/mock.py @@ -24,6 +24,7 @@ Compat module for Python3.x's unittest.mock module """ import sys +import _io # Python 2.7 @@ -100,8 +101,6 @@ def _readline_side_effect(): global file_spec if file_spec is None: - import _io - file_spec = list( set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))) )