From f8884f12bcda607dc0b8a993aa0b9ade1f3f191b Mon Sep 17 00:00:00 2001 From: Samer Deeb Date: Thu, 11 Jan 2018 14:21:17 -0800 Subject: [PATCH] Mellanox OS name change: MLNXOS changed to ONYX (#34753) * Mellanox OS name change: MLNXOS changed to ONYX Signed-off-by: Samer Deeb * Fix alphabetical order of modules metadata Signed-off-by: Samer Deeb --- .github/BOTMETA.yml | 28 ++++++------ .../dev_guide/developing_module_utilities.rst | 2 +- lib/ansible/config/base.yml | 2 +- .../network/{mlnxos => onyx}/__init__.py | 0 .../{mlnxos/mlnxos.py => onyx/onyx.py} | 2 +- .../network/{mlnxos => onyx}/__init__.py | 0 .../mlnxos_bgp.py => onyx/onyx_bgp.py} | 18 ++++---- .../onyx_command.py} | 30 ++++++------- .../mlnxos_config.py => onyx/onyx_config.py} | 20 ++++----- .../mlnxos_facts.py => onyx/onyx_facts.py} | 22 +++++----- .../onyx_interface.py} | 24 +++++----- .../onyx_l2_interface.py} | 18 ++++---- .../onyx_l3_interface.py} | 22 +++++----- .../onyx_linkagg.py} | 22 +++++----- .../mlnxos_lldp.py => onyx/onyx_lldp.py} | 18 ++++---- .../onyx_lldp_interface.py} | 26 +++++------ .../mlnxos_magp.py => onyx/onyx_magp.py} | 18 ++++---- .../onyx_mlag_ipl.py} | 20 ++++----- .../onyx_mlag_vip.py} | 18 ++++---- .../mlnxos_ospf.py => onyx/onyx_ospf.py} | 18 ++++---- .../onyx_pfc_interface.py} | 18 ++++---- .../onyx_protocol.py} | 18 ++++---- .../mlnxos_vlan.py => onyx/onyx_vlan.py} | 18 ++++---- .../{mlnxos_config.py => onyx_config.py} | 0 .../plugins/cliconf/{mlnxos.py => onyx.py} | 0 .../plugins/terminal/{mlnxos.py => onyx.py} | 0 .../{mlnxos.py => onyx.py} | 0 .../network/{mlnxos => onyx}/__init__.py | 0 .../fixtures/onyx_bgp_show.cfg} | 0 .../fixtures/onyx_command_show_version.txt} | 0 .../fixtures/onyx_config_config.cfg} | 0 .../fixtures/onyx_config_src.cfg} | 0 .../onyx_facts_show_interfaces_ethernet.cfg} | 0 .../fixtures/onyx_facts_show_module.cfg} | 0 .../fixtures/onyx_facts_show_version.cfg} | 0 .../fixtures/onyx_interfaces_rates.cfg} | 0 .../fixtures/onyx_interfaces_show.cfg} | 0 .../fixtures/onyx_interfaces_status.cfg} | 0 .../fixtures/onyx_l2_interface_show.cfg} | 0 .../fixtures/onyx_l3_interface_show.cfg} | 0 .../fixtures/onyx_l3_vlan_interface_show.cfg} | 0 .../fixtures/onyx_lldp_interface_show.cfg} | 0 .../fixtures/onyx_lldp_show.cfg} | 0 .../fixtures/onyx_magp_show.cfg} | 0 .../fixtures/onyx_mlag_ipl_show.cfg} | 0 .../fixtures/onyx_mlag_port_channel_show.cfg} | 0 .../fixtures/onyx_mlag_show.cfg} | 0 .../fixtures/onyx_mlag_vip_show.cfg} | 0 .../fixtures/onyx_ospf_interfaces_show.cfg} | 0 .../fixtures/onyx_ospf_show.cfg} | 0 .../fixtures/onyx_pfc_interface_disabled.cfg} | 0 .../fixtures/onyx_pfc_interface_enabled.cfg} | 0 .../fixtures/onyx_port_channel_show.cfg} | 0 .../fixtures/onyx_protocols_show.cfg} | 0 .../fixtures/onyx_vlan_show.cfg} | 0 .../mlnxos_module.py => onyx/onyx_module.py} | 2 +- .../test_onyx_bgp.py} | 18 ++++---- .../test_onyx_command.py} | 32 +++++++------- .../test_onyx_config.py} | 44 +++++++++---------- .../test_onyx_facts.py} | 24 +++++----- .../test_onyx_interface.py} | 30 ++++++------- .../test_onyx_l2_interface.py} | 18 ++++---- .../test_onyx_l3_interface.py} | 20 ++++----- .../test_onyx_linkagg.py} | 20 ++++----- .../test_onyx_lldp.py} | 19 ++++---- .../test_onyx_lldp_interface.py} | 18 ++++---- .../test_onyx_magp.py} | 18 ++++---- .../test_onyx_mlag_ipl.py} | 18 ++++---- .../test_onyx_mlag_vip.py} | 22 +++++----- .../test_onyx_ospf.py} | 22 +++++----- .../test_onyx_pfc_interface.py} | 18 ++++---- .../test_onyx_protocols.py} | 20 ++++----- .../test_onyx_vlan.py} | 19 ++++---- 73 files changed, 381 insertions(+), 383 deletions(-) rename lib/ansible/module_utils/network/{mlnxos => onyx}/__init__.py (100%) rename lib/ansible/module_utils/network/{mlnxos/mlnxos.py => onyx/onyx.py} (99%) rename lib/ansible/modules/network/{mlnxos => onyx}/__init__.py (100%) rename lib/ansible/modules/network/{mlnxos/mlnxos_bgp.py => onyx/onyx_bgp.py} (95%) rename lib/ansible/modules/network/{mlnxos/mlnxos_command.py => onyx/onyx_command.py} (89%) rename lib/ansible/modules/network/{mlnxos/mlnxos_config.py => onyx/onyx_config.py} (93%) rename lib/ansible/modules/network/{mlnxos/mlnxos_facts.py => onyx/onyx_facts.py} (93%) rename lib/ansible/modules/network/{mlnxos/mlnxos_interface.py => onyx/onyx_interface.py} (97%) rename lib/ansible/modules/network/{mlnxos/mlnxos_l2_interface.py => onyx/onyx_l2_interface.py} (95%) rename lib/ansible/modules/network/{mlnxos/mlnxos_l3_interface.py => onyx/onyx_l3_interface.py} (95%) rename lib/ansible/modules/network/{mlnxos/mlnxos_linkagg.py => onyx/onyx_linkagg.py} (96%) rename lib/ansible/modules/network/{mlnxos/mlnxos_lldp.py => onyx/onyx_lldp.py} (87%) rename lib/ansible/modules/network/{mlnxos/mlnxos_lldp_interface.py => onyx/onyx_lldp_interface.py} (93%) rename lib/ansible/modules/network/{mlnxos/mlnxos_magp.py => onyx/onyx_magp.py} (94%) rename lib/ansible/modules/network/{mlnxos/mlnxos_mlag_ipl.py => onyx/onyx_mlag_ipl.py} (93%) rename lib/ansible/modules/network/{mlnxos/mlnxos_mlag_vip.py => onyx/onyx_mlag_vip.py} (92%) rename lib/ansible/modules/network/{mlnxos/mlnxos_ospf.py => onyx/onyx_ospf.py} (95%) rename lib/ansible/modules/network/{mlnxos/mlnxos_pfc_interface.py => onyx/onyx_pfc_interface.py} (93%) rename lib/ansible/modules/network/{mlnxos/mlnxos_protocol.py => onyx/onyx_protocol.py} (93%) rename lib/ansible/modules/network/{mlnxos/mlnxos_vlan.py => onyx/onyx_vlan.py} (94%) rename lib/ansible/plugins/action/{mlnxos_config.py => onyx_config.py} (100%) rename lib/ansible/plugins/cliconf/{mlnxos.py => onyx.py} (100%) rename lib/ansible/plugins/terminal/{mlnxos.py => onyx.py} (100%) rename lib/ansible/utils/module_docs_fragments/{mlnxos.py => onyx.py} (100%) rename test/units/modules/network/{mlnxos => onyx}/__init__.py (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_bgp_show.cfg => onyx/fixtures/onyx_bgp_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_command_show_version.txt => onyx/fixtures/onyx_command_show_version.txt} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_config_config.cfg => onyx/fixtures/onyx_config_config.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_config_src.cfg => onyx/fixtures/onyx_config_src.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_facts_show_interfaces_ethernet.cfg => onyx/fixtures/onyx_facts_show_interfaces_ethernet.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_facts_show_module.cfg => onyx/fixtures/onyx_facts_show_module.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_facts_show_version.cfg => onyx/fixtures/onyx_facts_show_version.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_interfaces_rates.cfg => onyx/fixtures/onyx_interfaces_rates.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_interfaces_show.cfg => onyx/fixtures/onyx_interfaces_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_interfaces_status.cfg => onyx/fixtures/onyx_interfaces_status.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_l2_interface_show.cfg => onyx/fixtures/onyx_l2_interface_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_l3_interface_show.cfg => onyx/fixtures/onyx_l3_interface_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_l3_vlan_interface_show.cfg => onyx/fixtures/onyx_l3_vlan_interface_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_lldp_interface_show.cfg => onyx/fixtures/onyx_lldp_interface_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_lldp_show.cfg => onyx/fixtures/onyx_lldp_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_magp_show.cfg => onyx/fixtures/onyx_magp_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_mlag_ipl_show.cfg => onyx/fixtures/onyx_mlag_ipl_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_mlag_port_channel_show.cfg => onyx/fixtures/onyx_mlag_port_channel_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_mlag_show.cfg => onyx/fixtures/onyx_mlag_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_mlag_vip_show.cfg => onyx/fixtures/onyx_mlag_vip_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_ospf_interfaces_show.cfg => onyx/fixtures/onyx_ospf_interfaces_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_ospf_show.cfg => onyx/fixtures/onyx_ospf_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_pfc_interface_disabled.cfg => onyx/fixtures/onyx_pfc_interface_disabled.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_pfc_interface_enabled.cfg => onyx/fixtures/onyx_pfc_interface_enabled.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_port_channel_show.cfg => onyx/fixtures/onyx_port_channel_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_protocols_show.cfg => onyx/fixtures/onyx_protocols_show.cfg} (100%) rename test/units/modules/network/{mlnxos/fixtures/mlnxos_vlan_show.cfg => onyx/fixtures/onyx_vlan_show.cfg} (100%) rename test/units/modules/network/{mlnxos/mlnxos_module.py => onyx/onyx_module.py} (98%) rename test/units/modules/network/{mlnxos/test_mlnxos_bgp.py => onyx/test_onyx_bgp.py} (87%) rename test/units/modules/network/{mlnxos/test_mlnxos_command.py => onyx/test_onyx_command.py} (81%) rename test/units/modules/network/{mlnxos/test_mlnxos_config.py => onyx/test_onyx_config.py} (76%) rename test/units/modules/network/{mlnxos/test_mlnxos_facts.py => onyx/test_onyx_facts.py} (77%) rename test/units/modules/network/{mlnxos/test_mlnxos_interface.py => onyx/test_onyx_interface.py} (82%) rename test/units/modules/network/{mlnxos/test_mlnxos_l2_interface.py => onyx/test_onyx_l2_interface.py} (89%) rename test/units/modules/network/{mlnxos/test_mlnxos_l3_interface.py => onyx/test_onyx_l3_interface.py} (86%) rename test/units/modules/network/{mlnxos/test_mlnxos_linkagg.py => onyx/test_onyx_linkagg.py} (88%) rename test/units/modules/network/{mlnxos/test_mlnxos_lldp.py => onyx/test_onyx_lldp.py} (77%) rename test/units/modules/network/{mlnxos/test_mlnxos_lldp_interface.py => onyx/test_onyx_lldp_interface.py} (83%) rename test/units/modules/network/{mlnxos/test_mlnxos_magp.py => onyx/test_onyx_magp.py} (89%) rename test/units/modules/network/{mlnxos/test_mlnxos_mlag_ipl.py => onyx/test_onyx_mlag_ipl.py} (85%) rename test/units/modules/network/{mlnxos/test_mlnxos_mlag_vip.py => onyx/test_onyx_mlag_vip.py} (80%) rename test/units/modules/network/{mlnxos/test_mlnxos_ospf.py => onyx/test_onyx_ospf.py} (87%) rename test/units/modules/network/{mlnxos/test_mlnxos_pfc_interface.py => onyx/test_onyx_pfc_interface.py} (87%) rename test/units/modules/network/{mlnxos/test_mlnxos_protocols.py => onyx/test_onyx_protocols.py} (88%) rename test/units/modules/network/{mlnxos/test_mlnxos_vlan.py => onyx/test_onyx_vlan.py} (86%) diff --git a/.github/BOTMETA.yml b/.github/BOTMETA.yml index a9439232ef..e2c9adeab5 100644 --- a/.github/BOTMETA.yml +++ b/.github/BOTMETA.yml @@ -481,13 +481,13 @@ files: $modules/network/junos/: Qalthos ganeshrn $modules/network/layer2/: $team_networking $modules/network/layer3/: $team_networking - $modules/network/mlnxos/: $team_mlnxos $modules/network/netconf/netconf_config.py: ganeshrn lpenz userlerueda $modules/network/netscaler/: $team_netscaler $modules/network/netvisor/: $team_netvisor $modules/network/nuage/: pdellaert $modules/network/nxos/: $team_nxos $modules/network/nso/: $team_nso + $modules/network/onyx/: $team_onyx $modules/network/openvswitch/: ignored: stygstra maintainers: $team_networking @@ -989,9 +989,6 @@ files: $module_utils/network/ironware: maintainers: paulquack labels: networking - $module_utils/network/mlnxos: - maintainers: $team_mlnxos - labels: networking $module_utils/k8s_common.py: maintainers: chouseknecht sdoran maxamillion fabianvf flaper87 labels: clustering @@ -1003,6 +1000,9 @@ files: $module_utils/network/nso: maintainers: $team_nso labels: networking + $module_utils/network/onyx: + maintainers: $team_onyx + labels: networking $module_utils/openstack.py: maintainers: $team_openstack labels: @@ -1069,9 +1069,6 @@ files: lib/ansible/plugins/action/junos: maintainers: $team_networking labels: networking - lib/ansible/plugins/action/mlnxos_config.py: - maintainers: $team_mlnxos - labels: networking lib/ansible/plugins/action/net: maintainers: $team_networking labels: networking @@ -1080,6 +1077,9 @@ files: labels: - networking - nxos + lib/ansible/plugins/action/onyx_config.py: + maintainers: $team_onyx + labels: networking lib/ansible/plugins/action/sros: maintainers: $team_networking labels: networking @@ -1095,14 +1095,14 @@ files: lib/ansible/plugins/cliconf/ironware.py: maintainers: paulquack labels: networking - lib/ansible/plugins/cliconf/mlnxos.py: - maintainers: $team_mlnxos - labels: networking lib/ansible/plugins/cliconf/nxos.py: maintainers: $team_nxos labels: - networking - nxos + lib/ansible/plugins/cliconf/onyx.py: + maintainers: $team_onyx + labels: networking lib/ansible/plugins/connection/netconf.py: maintainers: $team_networking labels: networking @@ -1169,14 +1169,14 @@ files: lib/ansible/plugins/terminal/junos.py: maintainers: $team_networking labels: networking - lib/ansible/plugins/terminal/mlnxos.py: - maintainers: $team_mlnxos - labels: networking lib/ansible/plugins/terminal/nxos.py: maintainers: $team_networking labels: - networking - nxos + lib/ansible/plugins/terminal/onyx.py: + maintainers: $team_onyx + labels: networking lib/ansible/plugins/terminal/sros.py: maintainers: $team_networking labels: networking @@ -1222,13 +1222,13 @@ macros: team_azure: haroldwongms nitzmahone tstringer yuwzho xscript zikalino team_cumulus: isharacomix jrrivers privateip team_manageiq: gtanzillo abellotti zgalor yaacov cben - team_mlnxos: samerd team_netapp: hulquest lmprice broncofan gouthampacha team_netscaler: chiradeep giorgos-nikolopoulos team_netvisor: Qalthos amitsi gundalow privateip team_networking: Qalthos ganeshrn gundalow privateip rcarrillocruz trishnaguha kedarX team_nso: cmoberg pekdon team_nxos: mikewiebe privateip rahushen rcarrillocruz trishnaguha kedarX + team_onyx: samerd team_openstack: emonty j2sol juliakreger rcarrillocruz shrews thingee dagnello team_openswitch: Qalthos gundalow privateip team_rabbitmq: chrishoffman manuel-sousa hyperized diff --git a/docs/docsite/rst/dev_guide/developing_module_utilities.rst b/docs/docsite/rst/dev_guide/developing_module_utilities.rst index 8c67069330..7a7363f75a 100644 --- a/docs/docsite/rst/dev_guide/developing_module_utilities.rst +++ b/docs/docsite/rst/dev_guide/developing_module_utilities.rst @@ -48,10 +48,10 @@ The following is a list of module_utils files and a general description. The mod - network/iosxr/iosxr.py - Definitions and helper functions for modules that manage Cisco IOS-XR networking devices. - network/ironware/ironware.py - Module support utilities for managing Brocade IronWare devices. - network/junos/junos.py - Definitions and helper functions for modules that manage Junos networking devices. -- network/mlnxos/mlnxos.py - Definitions and helper functions for modules that manage Mellanox MLNX-OS networking devices. - network/netscaler/netscaler.py - Utilities specifically for the netscaler network modules. - network/nso/nso.py - Utilities for modules that work with Cisco NSO. - network/nxos/nxos.py - Contains definitions and helper functions specific to Cisco NXOS networking devices. +- network/onyx/onyx.py - Definitions and helper functions for modules that manage Mellanox ONYX networking devices. - network/ordance/ordance.py - Module support utilities for managing Ordnance devices. - network/sros/sros.py - Helper functions for modules working with Open vSwitch bridges. - network/vyos/vyos.py - Definitions and functions for working with VyOS networking diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 25b92dbc18..067defb2f4 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -1325,7 +1325,7 @@ MERGE_MULTIPLE_CLI_TAGS: version_added: "2.3" NETWORK_GROUP_MODULES: name: Network module families - default: [eos, nxos, ios, iosxr, junos, enos, ce, vyos, sros, dellos9, dellos10, dellos6, asa, aruba, aireos, bigip, ironware, mlnxos] + default: [eos, nxos, ios, iosxr, junos, enos, ce, vyos, sros, dellos9, dellos10, dellos6, asa, aruba, aireos, bigip, ironware, onyx] description: 'TODO: write it' env: [{name: NETWORK_GROUP_MODULES}] ini: diff --git a/lib/ansible/module_utils/network/mlnxos/__init__.py b/lib/ansible/module_utils/network/onyx/__init__.py similarity index 100% rename from lib/ansible/module_utils/network/mlnxos/__init__.py rename to lib/ansible/module_utils/network/onyx/__init__.py diff --git a/lib/ansible/module_utils/network/mlnxos/mlnxos.py b/lib/ansible/module_utils/network/onyx/onyx.py similarity index 99% rename from lib/ansible/module_utils/network/mlnxos/mlnxos.py rename to lib/ansible/module_utils/network/onyx/onyx.py index 9f4d95939f..e976a65c60 100644 --- a/lib/ansible/module_utils/network/mlnxos/mlnxos.py +++ b/lib/ansible/module_utils/network/onyx/onyx.py @@ -145,7 +145,7 @@ def get_bgp_summary(module): return show_cmd(module, cmd, json_fmt=False, fail_on_error=False) -class BaseMlnxosModule(object): +class BaseOnyxModule(object): def __init__(self): self._module = None diff --git a/lib/ansible/modules/network/mlnxos/__init__.py b/lib/ansible/modules/network/onyx/__init__.py similarity index 100% rename from lib/ansible/modules/network/mlnxos/__init__.py rename to lib/ansible/modules/network/onyx/__init__.py diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_bgp.py b/lib/ansible/modules/network/onyx/onyx_bgp.py similarity index 95% rename from lib/ansible/modules/network/mlnxos/mlnxos_bgp.py rename to lib/ansible/modules/network/onyx/onyx_bgp.py index 4d6fe9e2dc..eb3a19326a 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_bgp.py +++ b/lib/ansible/modules/network/onyx/onyx_bgp.py @@ -12,15 +12,15 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_bgp +module: onyx_bgp version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Configures BGP on Mellanox MLNX-OS network devices +short_description: Configures BGP on Mellanox ONYX network devices description: - This module provides declarative management of BGP router and neighbors - on Mellanox MLNX-OS network devices. + on Mellanox ONYX network devices. notes: - - Tested on MLNX-OS 3.6.4000 + - Tested on ONYX 3.6.4000 options: as_number: description: @@ -53,7 +53,7 @@ options: EXAMPLES = """ - name: configure bgp - mlnxos_bgp: + onyx_bgp: as_number: 320 router_id: 10.3.3.3 neighbors: @@ -81,11 +81,11 @@ import re from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.network.mlnxos.mlnxos import get_bgp_summary -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule +from ansible.module_utils.network.onyx.onyx import get_bgp_summary +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule -class MlnxosBgpModule(BaseMlnxosModule): +class OnyxBgpModule(BaseOnyxModule): LOCAL_AS_REGEX = re.compile(r'^\s+router bgp\s+(\d+).*') ROUTER_ID_REGEX = re.compile( r'^\s+router bgp\s+(\d+).*router-id\s+(\S+)\s+.*') @@ -249,7 +249,7 @@ class MlnxosBgpModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosBgpModule.main() + OnyxBgpModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_command.py b/lib/ansible/modules/network/onyx/onyx_command.py similarity index 89% rename from lib/ansible/modules/network/mlnxos/mlnxos_command.py rename to lib/ansible/modules/network/onyx/onyx_command.py index eb0227440a..134e8a5dd7 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_command.py +++ b/lib/ansible/modules/network/onyx/onyx_command.py @@ -12,25 +12,25 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_command -extends_documentation_fragment: mlnxos +module: onyx_command +extends_documentation_fragment: onyx version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Run commands on remote devices running Mellanox MLNX-OS +short_description: Run commands on remote devices running Mellanox ONYX description: - - Sends arbitrary commands to an Mellanox MLNX-OS network device and returns + - Sends arbitrary commands to an Mellanox ONYX network device and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met. - This module does not support running commands in configuration mode. - Please use M(mlnxos_config) to configure Mellanox MLNX-OS devices. + Please use M(onyx_config) to configure Mellanox ONYX devices. notes: - - Tested on MLNX-OS 3.6.4000 + - Tested on ONYX 3.6.4000 options: commands: description: - - List of commands to send to the remote mlnxos device over the - configured provider. The resulting output from the command + - List of commands to send to the remote Mellanox ONYX network device. + 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. @@ -71,22 +71,22 @@ options: EXAMPLES = """ tasks: - name: run show version on remote devices - mlnxos_command: + onyx_command: commands: show version - name: run show version and check to see if output contains MLNXOS - mlnxos_command: + onyx_command: commands: show version wait_for: result[0] contains MLNXOS - name: run multiple commands on remote nodes - mlnxos_command: + onyx_command: commands: - show version - show interfaces - name: run multiple commands and evaluate the output - mlnxos_command: + onyx_command: commands: - show version - show interfaces @@ -120,7 +120,7 @@ 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.mlnxos.mlnxos import run_commands +from ansible.module_utils.network.onyx.onyx import run_commands def to_lines(stdout): @@ -146,8 +146,8 @@ def parse_commands(module, warnings): commands.remove(item) elif item['command'].startswith('conf'): module.fail_json( - msg='mlnxos_command does not support running config mode ' - 'commands. Please use mlnxos_config instead' + msg='onyx_command does not support running config mode ' + 'commands. Please use onyx_config instead' ) return commands diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_config.py b/lib/ansible/modules/network/onyx/onyx_config.py similarity index 93% rename from lib/ansible/modules/network/mlnxos/mlnxos_config.py rename to lib/ansible/modules/network/onyx/onyx_config.py index 8d5f184b21..4d6e527fa4 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_config.py +++ b/lib/ansible/modules/network/onyx/onyx_config.py @@ -12,15 +12,15 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_config -extends_documentation_fragment: mlnxos +module: onyx_config +extends_documentation_fragment: onyx version_added: "2.5" author: "Alex Tabachnik (@atabachnik), Samer Deeb (@samerd)" -short_description: Manage Mellanox MLNX-OS configuration sections +short_description: Manage Mellanox ONYX configuration sections description: - - Mellanox MLNX-OS configurations uses a simple block indent file syntax + - Mellanox ONYX configurations uses a simple block indent file syntax for segmenting configuration into sections. This module provides - an implementation for working with MLNX-OS configuration sections in + an implementation for working with ONYX configuration sections in a deterministic way. options: lines: @@ -105,7 +105,7 @@ options: EXAMPLES = """ --- -- mlnxos_config: +- onyx_config: lines: - snmp-server community - snmp-server host 10.2.2.2 traps version 2c @@ -121,15 +121,15 @@ backup_path: description: The full path to the backup file returned: when backup is yes type: string - sample: /playbooks/ansible/backup/mlnxos_config.2016-07-16@22:28:34 + sample: /playbooks/ansible/backup/onyx_config.2016-07-16@22:28:34 """ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.common.config import NetworkConfig, dumps -from ansible.module_utils.network.mlnxos.mlnxos import get_config -from ansible.module_utils.network.mlnxos.mlnxos import load_config -from ansible.module_utils.network.mlnxos.mlnxos import run_commands +from ansible.module_utils.network.onyx.onyx import get_config +from ansible.module_utils.network.onyx.onyx import load_config +from ansible.module_utils.network.onyx.onyx import run_commands def get_candidate(module): diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_facts.py b/lib/ansible/modules/network/onyx/onyx_facts.py similarity index 93% rename from lib/ansible/modules/network/mlnxos/mlnxos_facts.py rename to lib/ansible/modules/network/onyx/onyx_facts.py index ce09c6b822..3a139ab13b 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_facts.py +++ b/lib/ansible/modules/network/onyx/onyx_facts.py @@ -12,18 +12,18 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_facts +module: onyx_facts version_added: "2.5" author: "Waleed Mousa (@waleedym), Samer Deeb (@samerd)" -short_description: Collect facts from Mellanox MLNX-OS network devices +short_description: Collect facts from Mellanox ONYX network devices description: - - Collects a base set of device facts from a MLNX-OS Mellanox network devices + - Collects a base set of device facts from a ONYX Mellanox network devices This module prepends all of the base network fact keys with C(ansible_net_). The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts. notes: - - Tested against MLNX-OS 3.6 + - Tested against ONYX 3.6 options: gather_subset: description: @@ -40,16 +40,16 @@ options: EXAMPLES = """ --- - name: Collect all facts from the device - mlnxos_facts: + onyx_facts: gather_subset: all - name: Collect only the interfaces facts - mlnxos_facts: + onyx_facts: gather_subset: - interfaces - name: Do not collect version facts - mlnxos_facts: + onyx_facts: gather_subset: - "!version" """ @@ -82,11 +82,11 @@ ansible_net_interfaces: from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import iteritems -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosFactsModule(BaseMlnxosModule): +class OnyxFactsModule(BaseOnyxModule): def get_runable_subset(self, gather_subset): runable_subsets = set() @@ -231,7 +231,7 @@ VALID_SUBSETS = frozenset(FACT_SUBSETS.keys()) def main(): """ main entry point for module execution """ - MlnxosFactsModule.main() + OnyxFactsModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_interface.py b/lib/ansible/modules/network/onyx/onyx_interface.py similarity index 97% rename from lib/ansible/modules/network/mlnxos/mlnxos_interface.py rename to lib/ansible/modules/network/onyx/onyx_interface.py index e6a6b22c22..9e1c189fde 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_interface.py +++ b/lib/ansible/modules/network/onyx/onyx_interface.py @@ -12,13 +12,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_interface +module: onyx_interface version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage Interfaces on Mellanox MLNX-OS network devices +short_description: Manage Interfaces on Mellanox ONYX network devices description: - This module provides declarative management of Interfaces - on Mellanox MLNX-OS network devices. + on Mellanox ONYX network devices. notes: options: name: @@ -74,29 +74,29 @@ options: EXAMPLES = """ - name: configure interface - mlnxos_interface: + onyx_interface: name: Eth1/2 description: test-interface speed: 100 GB mtu: 512 - name: make interface up - mlnxos_interface: + onyx_interface: name: Eth1/2 enabled: True - name: make interface down - mlnxos_interface: + onyx_interface: name: Eth1/2 enabled: False - name: Check intent arguments - mlnxos_interface: + onyx_interface: name: Eth1/2 state: up - name: Config + intent - mlnxos_interface: + onyx_interface: name: Eth1/2 enabled: False state: down @@ -123,11 +123,11 @@ from ansible.module_utils.six import iteritems from ansible.module_utils.network.common.utils import conditional from ansible.module_utils.network.common.utils import remove_default_spec -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import get_interfaces_config +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import get_interfaces_config -class MlnxosInterfaceModule(BaseMlnxosModule): +class OnyxInterfaceModule(BaseOnyxModule): IF_ETH_REGEX = re.compile(r"^Eth(\d+\/\d+|Eth\d+\/\d+\d+)$") IF_VLAN_REGEX = re.compile(r"^Vlan (\d+)$") IF_LOOPBACK_REGEX = re.compile(r"^Loopback (\d+)$") @@ -475,7 +475,7 @@ class MlnxosInterfaceModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosInterfaceModule.main() + OnyxInterfaceModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_l2_interface.py b/lib/ansible/modules/network/onyx/onyx_l2_interface.py similarity index 95% rename from lib/ansible/modules/network/mlnxos/mlnxos_l2_interface.py rename to lib/ansible/modules/network/onyx/onyx_l2_interface.py index e22ad0d0b8..ee25c4031d 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_l2_interface.py +++ b/lib/ansible/modules/network/onyx/onyx_l2_interface.py @@ -12,13 +12,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_l2_interface +module: onyx_l2_interface version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage Layer-2 interface on Mellanox MLNX-OS network devices +short_description: Manage Layer-2 interface on Mellanox ONYX network devices description: - This module provides declarative management of Layer-2 interface - on Mellanox MLNX-OS network devices. + on Mellanox ONYX network devices. options: name: description: @@ -46,13 +46,13 @@ options: EXAMPLES = """ - name: configure Layer-2 interface - mlnxos_l2_interface: + onyx_l2_interface: name: Eth1/1 mode: access access_vlan: 30 - name: remove Layer-2 interface configuration - mlnxos_l2_interface: + onyx_l2_interface: name: Eth1/1 state: absent """ @@ -74,11 +74,11 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import iteritems from ansible.module_utils.network.common.utils import remove_default_spec -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import get_interfaces_config +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import get_interfaces_config -class MlnxosL2InterfaceModule(BaseMlnxosModule): +class OnyxL2InterfaceModule(BaseOnyxModule): IFNAME_REGEX = re.compile(r"^.*(Eth\d+\/\d+|Mpo\d+|Po\d+)") @classmethod @@ -277,7 +277,7 @@ class MlnxosL2InterfaceModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosL2InterfaceModule.main() + OnyxL2InterfaceModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_l3_interface.py b/lib/ansible/modules/network/onyx/onyx_l3_interface.py similarity index 95% rename from lib/ansible/modules/network/mlnxos/mlnxos_l3_interface.py rename to lib/ansible/modules/network/onyx/onyx_l3_interface.py index c4e7456f8a..93583e11ee 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_l3_interface.py +++ b/lib/ansible/modules/network/onyx/onyx_l3_interface.py @@ -12,13 +12,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_l3_interface +module: onyx_l3_interface version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage L3 interfaces on Mellanox MLNX-OS network devices +short_description: Manage L3 interfaces on Mellanox ONYX network devices description: - This module provides declarative management of L3 interfaces - on Mellanox MLNX-OS network devices. + on Mellanox ONYX network devices. options: name: description: @@ -45,23 +45,23 @@ options: EXAMPLES = """ - name: Set Eth1/1 IPv4 address - mlnxos_l3_interface: + onyx_l3_interface: name: Eth1/1 ipv4: 192.168.0.1/24 - name: Remove Eth1/1 IPv4 address - mlnxos_l3_interface: + onyx_l3_interface: name: Eth1/1 state: absent - name: Set IP addresses on aggregate - mlnxos_l3_interface: + onyx_l3_interface: aggregate: - { name: Eth1/1, ipv4: 192.168.2.10/24 } - { name: Eth1/2, ipv4: 192.168.3.10/24 } - name: Remove IP addresses on aggregate - mlnxos_l3_interface: + onyx_l3_interface: aggregate: - { name: Eth1/1, ipv4: 192.168.2.10/24 } - { name: Eth1/2, ipv4: 192.168.3.10/24 } @@ -83,11 +83,11 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import iteritems from ansible.module_utils.network.common.utils import remove_default_spec -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import get_interfaces_config +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import get_interfaces_config -class MlnxosL3InterfaceModule(BaseMlnxosModule): +class OnyxL3InterfaceModule(BaseOnyxModule): IF_ETH_REGEX = re.compile(r"^Eth(\d+\/\d+|Eth\d+\/\d+\d+)$") IF_VLAN_REGEX = re.compile(r"^Vlan (\d+)$") IF_LOOPBACK_REGEX = re.compile(r"^Loopback (\d+)$") @@ -285,7 +285,7 @@ class MlnxosL3InterfaceModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosL3InterfaceModule.main() + OnyxL3InterfaceModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_linkagg.py b/lib/ansible/modules/network/onyx/onyx_linkagg.py similarity index 96% rename from lib/ansible/modules/network/mlnxos/mlnxos_linkagg.py rename to lib/ansible/modules/network/onyx/onyx_linkagg.py index cdebb4481a..426cb9df63 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_linkagg.py +++ b/lib/ansible/modules/network/onyx/onyx_linkagg.py @@ -12,13 +12,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_linkagg +module: onyx_linkagg version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage link aggregation groups on Mellanox MLNX-OS network devices +short_description: Manage link aggregation groups on Mellanox ONYX network devices description: - This module provides declarative management of link aggregation groups - on Mellanox MLNX-OS network devices. + on Mellanox ONYX network devices. options: name: description: @@ -53,25 +53,25 @@ options: EXAMPLES = """ - name: configure link aggregation group - mlnxos_linkagg: + onyx_linkagg: name: Po1 members: - Eth1/1 - Eth1/2 - name: remove configuration - mlnxos_linkagg: + onyx_linkagg: name: Po1 state: absent - name: Create aggregate of linkagg definitions - mlnxos_linkagg: + onyx_linkagg: aggregate: - { name: Po1, members: [Eth1/1] } - { name: Po2, members: [Eth1/2] } - name: Remove aggregate of linkagg definitions - mlnxos_linkagg: + onyx_linkagg: aggregate: - name: Po1 - name: Po2 @@ -97,11 +97,11 @@ from ansible.module_utils.network.common.utils import remove_default_spec from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import iteritems -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import get_interfaces_config +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import get_interfaces_config -class MlnxosLinkAggModule(BaseMlnxosModule): +class OnyxLinkAggModule(BaseOnyxModule): LAG_ID_REGEX = re.compile(r"^\d+ (Po\d+|Mpo\d+)\(([A-Z])\)$") LAG_NAME_REGEX = re.compile(r"^(Po|Mpo)(\d+)$") IF_NAME_REGEX = re.compile(r"^(Eth\d+\/\d+|Eth\d+\/\d+\/\d+)(.*)$") @@ -334,7 +334,7 @@ class MlnxosLinkAggModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosLinkAggModule.main() + OnyxLinkAggModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_lldp.py b/lib/ansible/modules/network/onyx/onyx_lldp.py similarity index 87% rename from lib/ansible/modules/network/mlnxos/mlnxos_lldp.py rename to lib/ansible/modules/network/onyx/onyx_lldp.py index c9b757e610..b46ef9fc02 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_lldp.py +++ b/lib/ansible/modules/network/onyx/onyx_lldp.py @@ -12,13 +12,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_lldp +module: onyx_lldp version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage LLDP configuration on Mellanox MLNX-OS network devices +short_description: Manage LLDP configuration on Mellanox ONYX network devices description: - This module provides declarative management of LLDP service configuration - on Mellanox MLNX-OS network devices. + on Mellanox ONYX network devices. options: state: description: @@ -29,11 +29,11 @@ options: EXAMPLES = """ - name: Enable LLDP protocol - mlnxos_lldp: + onyx_lldp: state: present - name: Disable LLDP protocol - mlnxos_lldp: + onyx_lldp: state: lldp """ @@ -48,11 +48,11 @@ commands: from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosLldpModule(BaseMlnxosModule): +class OnyxLldpModule(BaseOnyxModule): LLDP_ENTRY = 'LLDP' SHOW_LLDP_CMD = 'show lldp local' @@ -110,7 +110,7 @@ class MlnxosLldpModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosLldpModule.main() + OnyxLldpModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_lldp_interface.py b/lib/ansible/modules/network/onyx/onyx_lldp_interface.py similarity index 93% rename from lib/ansible/modules/network/mlnxos/mlnxos_lldp_interface.py rename to lib/ansible/modules/network/onyx/onyx_lldp_interface.py index f1faeb66b1..38824d4750 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_lldp_interface.py +++ b/lib/ansible/modules/network/onyx/onyx_lldp_interface.py @@ -12,13 +12,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_lldp_interface +module: onyx_lldp_interface version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage LLDP interfaces configuration on Mellanox MLNX-OS network devices +short_description: Manage LLDP interfaces configuration on Mellanox ONYX network devices description: - This module provides declarative management of LLDP interfaces - configuration on Mellanox MLNX-OS network devices. + configuration on Mellanox ONYX network devices. options: name: description: @@ -39,34 +39,34 @@ options: EXAMPLES = """ - name: Configure LLDP on specific interfaces - mlnxos_lldp_interface: + onyx_lldp_interface: name: Eth1/1 state: present - name: Disable LLDP on specific interfaces - mlnxos_lldp_interface: + onyx_lldp_interface: name: Eth1/1 state: disabled - name: Enable LLDP on specific interfaces - mlnxos_lldp_interface: + onyx_lldp_interface: name: Eth1/1 state: enabled - name: Delete LLDP on specific interfaces - mlnxos_lldp_interface: + onyx_lldp_interface: name: Eth1/1 state: absent - name: Create aggregate of LLDP interface configurations - mlnxos_lldp_interface: + onyx_lldp_interface: aggregate: - { name: Eth1/1 } - { name: Eth1/2 } state: present - name: Delete aggregate of LLDP interface configurations - mlnxos_lldp_interface: + onyx_lldp_interface: aggregate: - { name: Eth1/1 } - { name: Eth1/2 } @@ -89,11 +89,11 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import iteritems from ansible.module_utils.network.common.utils import remove_default_spec -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosLldpInterfaceModule(BaseMlnxosModule): +class OnyxLldpInterfaceModule(BaseOnyxModule): IF_NAME_REGEX = re.compile(r"^(Eth\d+\/\d+|Eth\d+\/\d+\d+)$") _purge = False @@ -222,7 +222,7 @@ class MlnxosLldpInterfaceModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosLldpInterfaceModule.main() + OnyxLldpInterfaceModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_magp.py b/lib/ansible/modules/network/onyx/onyx_magp.py similarity index 94% rename from lib/ansible/modules/network/mlnxos/mlnxos_magp.py rename to lib/ansible/modules/network/onyx/onyx_magp.py index 85eb898756..2b42941193 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_magp.py +++ b/lib/ansible/modules/network/onyx/onyx_magp.py @@ -12,15 +12,15 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_magp +module: onyx_magp version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage MAGP protocol on Mellanox MLNX-OS network devices +short_description: Manage MAGP protocol on Mellanox ONYX network devices description: - This module provides declarative management of MAGP protocol on vlan - interface of Mellanox MLNX-OS network devices. + interface of Mellanox ONYX network devices. notes: - - Tested on MLNX-OS 3.6.4000 + - Tested on ONYX 3.6.4000 options: magp_id: description: @@ -45,7 +45,7 @@ options: EXAMPLES = """ - name: run add vlan interface with magp - mlnxos_magp: + onyx_magp: magp_id: 103 router_ip: 192.168.8.2 router_mac: AA:1B:2C:3D:4E:5F @@ -66,11 +66,11 @@ import re from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosMagpModule(BaseMlnxosModule): +class OnyxMagpModule(BaseOnyxModule): IF_VLAN_REGEX = re.compile(r"^Vlan (\d+)$") @classmethod @@ -220,7 +220,7 @@ class MlnxosMagpModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosMagpModule.main() + OnyxMagpModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_mlag_ipl.py b/lib/ansible/modules/network/onyx/onyx_mlag_ipl.py similarity index 93% rename from lib/ansible/modules/network/mlnxos/mlnxos_mlag_ipl.py rename to lib/ansible/modules/network/onyx/onyx_mlag_ipl.py index 2ed7259095..4befcf866a 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_mlag_ipl.py +++ b/lib/ansible/modules/network/onyx/onyx_mlag_ipl.py @@ -12,15 +12,15 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_mlag_ipl +module: onyx_mlag_ipl version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage IPL (inter-peer link) on Mellanox MLNX-OS network devices +short_description: Manage IPL (inter-peer link) on Mellanox ONYX network devices description: - This module provides declarative management of IPL (inter-peer link) - management on Mellanox MLNX-OS network devices. + management on Mellanox ONYX network devices. notes: - - Tested on MLNX-OS 3.6.4000 + - Tested on ONYX 3.6.4000 options: name: description: @@ -41,14 +41,14 @@ options: EXAMPLES = """ - name: run configure ipl - mlnxos_mlag_ipl: + onyx_mlag_ipl: name: Po1 vlan_interface: Vlan 322 state: present peer_address: 192.168.7.1 - name: run remove ipl - mlnxos_mlag_ipl: + onyx_mlag_ipl: name: Po1 state: absent """ @@ -66,11 +66,11 @@ import re from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosMlagIplModule(BaseMlnxosModule): +class OnyxMlagIplModule(BaseOnyxModule): VLAN_IF_REGEX = re.compile(r'^Vlan \d+') @classmethod @@ -203,7 +203,7 @@ class MlnxosMlagIplModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosMlagIplModule.main() + OnyxMlagIplModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_mlag_vip.py b/lib/ansible/modules/network/onyx/onyx_mlag_vip.py similarity index 92% rename from lib/ansible/modules/network/mlnxos/mlnxos_mlag_vip.py rename to lib/ansible/modules/network/onyx/onyx_mlag_vip.py index 3f637cc9c6..ca639a6fb6 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_mlag_vip.py +++ b/lib/ansible/modules/network/onyx/onyx_mlag_vip.py @@ -12,15 +12,15 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_mlag_vip +module: onyx_mlag_vip version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Configures MLAG VIP on Mellanox MLNX-OS network devices +short_description: Configures MLAG VIP on Mellanox ONYX network devices description: - This module provides declarative management of MLAG virtual IPs - on Mellanox MLNX-OS network devices. + on Mellanox ONYX network devices. notes: - - Tested on MLNX-OS 3.6.4000 + - Tested on ONYX 3.6.4000 options: ipaddress: description: @@ -44,7 +44,7 @@ options: EXAMPLES = """ - name: configure mlag-vip - mlnxos_mlag_vip: + onyx_mlag_vip: ipaddress: 50.3.3.1/24 group_name: ansible-test-group mac_address: 00:11:12:23:34:45 @@ -64,11 +64,11 @@ import time from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosMLagVipModule(BaseMlnxosModule): +class OnyxMLagVipModule(BaseOnyxModule): def init_module(self): """ initialize module @@ -172,7 +172,7 @@ class MlnxosMLagVipModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosMLagVipModule.main() + OnyxMLagVipModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_ospf.py b/lib/ansible/modules/network/onyx/onyx_ospf.py similarity index 95% rename from lib/ansible/modules/network/mlnxos/mlnxos_ospf.py rename to lib/ansible/modules/network/onyx/onyx_ospf.py index ca7f526cc3..c5ec9f7f7f 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_ospf.py +++ b/lib/ansible/modules/network/onyx/onyx_ospf.py @@ -12,15 +12,15 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_ospf +module: onyx_ospf version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage OSPF protocol on Mellanox MLNX-OS network devices +short_description: Manage OSPF protocol on Mellanox ONYX network devices description: - This module provides declarative management and configuration of OSPF - protocol on Mellanox MLNX-OS network devices. + protocol on Mellanox ONYX network devices. notes: - - Tested on MLNX-OS 3.6.4000 + - Tested on ONYX 3.6.4000 options: ospf: description: @@ -50,7 +50,7 @@ options: EXAMPLES = """ - name: add ospf router to interface - mlnxos_ospf: + onyx_ospf: ospf: 2 router_id: 192.168.8.2 interfaces: @@ -74,11 +74,11 @@ import re from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import iteritems -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosOspfModule(BaseMlnxosModule): +class OnyxOspfModule(BaseOnyxModule): OSPF_IF_REGEX = re.compile( r'^(Loopback\d+|Eth\d+\/\d+|Vlan\d+|Po\d+)\s+(\S+).*') OSPF_ROUTER_REGEX = re.compile(r'^Routing Process (\d+).*ID\s+(\S+).*') @@ -231,7 +231,7 @@ class MlnxosOspfModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosOspfModule.main() + OnyxOspfModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_pfc_interface.py b/lib/ansible/modules/network/onyx/onyx_pfc_interface.py similarity index 93% rename from lib/ansible/modules/network/mlnxos/mlnxos_pfc_interface.py rename to lib/ansible/modules/network/onyx/onyx_pfc_interface.py index c117d5b310..9b342cb28f 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_pfc_interface.py +++ b/lib/ansible/modules/network/onyx/onyx_pfc_interface.py @@ -12,15 +12,15 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_pfc_interface +module: onyx_pfc_interface version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Manage priority flow control on MLNX-OS network devices +short_description: Manage priority flow control on ONYX network devices description: - This module provides declarative management of priority flow control (PFC) - on interfaces of Mellanox MLNX-OS network devices. + on interfaces of Mellanox ONYX network devices. notes: - - Tested on MLNX-OS 3.6.4000 + - Tested on ONYX 3.6.4000 options: name: description: @@ -41,7 +41,7 @@ options: EXAMPLES = """ - name: configure PFC - mlnxos_pfc_interface: + onyx_pfc_interface: name: Eth1/1 state: enabled """ @@ -61,11 +61,11 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.common.utils import remove_default_spec from ansible.module_utils.six import iteritems -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosPfcInterfaceModule(BaseMlnxosModule): +class OnyxPfcInterfaceModule(BaseOnyxModule): PFC_IF_REGEX = re.compile( r"^(Eth\d+\/\d+)|(Eth\d+\/\d+\/\d+)|(Po\d+)|(Mpo\d+)$") @@ -198,7 +198,7 @@ class MlnxosPfcInterfaceModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosPfcInterfaceModule.main() + OnyxPfcInterfaceModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_protocol.py b/lib/ansible/modules/network/onyx/onyx_protocol.py similarity index 93% rename from lib/ansible/modules/network/mlnxos/mlnxos_protocol.py rename to lib/ansible/modules/network/onyx/onyx_protocol.py index ff7869cf58..7594413612 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_protocol.py +++ b/lib/ansible/modules/network/onyx/onyx_protocol.py @@ -12,15 +12,15 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_protocol +module: onyx_protocol version_added: "2.5" author: "Samer Deeb (@samerd)" -short_description: Enables/Disables protocols on Mellanox MLNX-OS network devices +short_description: Enables/Disables protocols on Mellanox ONYX network devices description: - This module provides a mechanism for enabling and disabling protocols - Mellanox on MLNX-OS network devices. + Mellanox on ONYX network devices. notes: - - Tested on MLNX-OS 3.6.4000 + - Tested on ONYX 3.6.4000 options: mlag: description: MLAG protocol @@ -59,7 +59,7 @@ options: EXAMPLES = """ - name: enable protocols for MLAG - mlnxos_protocol: + onyx_protocol: lacp: enabled spanning_tree: disabled ip_routing: enabled @@ -80,11 +80,11 @@ commands: from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import iteritems -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosProtocolModule(BaseMlnxosModule): +class OnyxProtocolModule(BaseOnyxModule): PROTOCOL_MAPPING = dict( mlag=dict(name="mlag", enable="protocol mlag", @@ -178,7 +178,7 @@ class MlnxosProtocolModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosProtocolModule.main() + OnyxProtocolModule.main() if __name__ == '__main__': diff --git a/lib/ansible/modules/network/mlnxos/mlnxos_vlan.py b/lib/ansible/modules/network/onyx/onyx_vlan.py similarity index 94% rename from lib/ansible/modules/network/mlnxos/mlnxos_vlan.py rename to lib/ansible/modules/network/onyx/onyx_vlan.py index 1c16f8da9a..e1bedf41bd 100644 --- a/lib/ansible/modules/network/mlnxos/mlnxos_vlan.py +++ b/lib/ansible/modules/network/onyx/onyx_vlan.py @@ -12,13 +12,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = """ --- -module: mlnxos_vlan +module: onyx_vlan version_added: "2.5" author: "Samer Deeb (@samerd) Alex Tabachnik (@atabachnik)" -short_description: Manage VLANs on Mellanox MLNX-OS network devices +short_description: Manage VLANs on Mellanox ONYX network devices description: - This module provides declarative management of VLANs - on Mellanox MLNX-OS network devices. + on Mellanox ONYX network devices. options: name: description: @@ -41,12 +41,12 @@ options: EXAMPLES = """ - name: configure VLAN ID and name - mlnxos_vlan: + onyx_vlan: vlan_id: 20 name: test-vlan - name: remove configuration - mlnxos_vlan: + onyx_vlan: state: absent """ @@ -67,11 +67,11 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import iteritems from ansible.module_utils.network.common.utils import remove_default_spec -from ansible.module_utils.network.mlnxos.mlnxos import BaseMlnxosModule -from ansible.module_utils.network.mlnxos.mlnxos import show_cmd +from ansible.module_utils.network.onyx.onyx import BaseOnyxModule +from ansible.module_utils.network.onyx.onyx import show_cmd -class MlnxosVlanModule(BaseMlnxosModule): +class OnyxVlanModule(BaseOnyxModule): _purge = False @classmethod @@ -194,7 +194,7 @@ class MlnxosVlanModule(BaseMlnxosModule): def main(): """ main entry point for module execution """ - MlnxosVlanModule.main() + OnyxVlanModule.main() if __name__ == '__main__': diff --git a/lib/ansible/plugins/action/mlnxos_config.py b/lib/ansible/plugins/action/onyx_config.py similarity index 100% rename from lib/ansible/plugins/action/mlnxos_config.py rename to lib/ansible/plugins/action/onyx_config.py diff --git a/lib/ansible/plugins/cliconf/mlnxos.py b/lib/ansible/plugins/cliconf/onyx.py similarity index 100% rename from lib/ansible/plugins/cliconf/mlnxos.py rename to lib/ansible/plugins/cliconf/onyx.py diff --git a/lib/ansible/plugins/terminal/mlnxos.py b/lib/ansible/plugins/terminal/onyx.py similarity index 100% rename from lib/ansible/plugins/terminal/mlnxos.py rename to lib/ansible/plugins/terminal/onyx.py diff --git a/lib/ansible/utils/module_docs_fragments/mlnxos.py b/lib/ansible/utils/module_docs_fragments/onyx.py similarity index 100% rename from lib/ansible/utils/module_docs_fragments/mlnxos.py rename to lib/ansible/utils/module_docs_fragments/onyx.py diff --git a/test/units/modules/network/mlnxos/__init__.py b/test/units/modules/network/onyx/__init__.py similarity index 100% rename from test/units/modules/network/mlnxos/__init__.py rename to test/units/modules/network/onyx/__init__.py diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_bgp_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_bgp_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_bgp_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_bgp_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_command_show_version.txt b/test/units/modules/network/onyx/fixtures/onyx_command_show_version.txt similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_command_show_version.txt rename to test/units/modules/network/onyx/fixtures/onyx_command_show_version.txt diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_config_config.cfg b/test/units/modules/network/onyx/fixtures/onyx_config_config.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_config_config.cfg rename to test/units/modules/network/onyx/fixtures/onyx_config_config.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_config_src.cfg b/test/units/modules/network/onyx/fixtures/onyx_config_src.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_config_src.cfg rename to test/units/modules/network/onyx/fixtures/onyx_config_src.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_facts_show_interfaces_ethernet.cfg b/test/units/modules/network/onyx/fixtures/onyx_facts_show_interfaces_ethernet.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_facts_show_interfaces_ethernet.cfg rename to test/units/modules/network/onyx/fixtures/onyx_facts_show_interfaces_ethernet.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_facts_show_module.cfg b/test/units/modules/network/onyx/fixtures/onyx_facts_show_module.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_facts_show_module.cfg rename to test/units/modules/network/onyx/fixtures/onyx_facts_show_module.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_facts_show_version.cfg b/test/units/modules/network/onyx/fixtures/onyx_facts_show_version.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_facts_show_version.cfg rename to test/units/modules/network/onyx/fixtures/onyx_facts_show_version.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_interfaces_rates.cfg b/test/units/modules/network/onyx/fixtures/onyx_interfaces_rates.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_interfaces_rates.cfg rename to test/units/modules/network/onyx/fixtures/onyx_interfaces_rates.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_interfaces_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_interfaces_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_interfaces_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_interfaces_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_interfaces_status.cfg b/test/units/modules/network/onyx/fixtures/onyx_interfaces_status.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_interfaces_status.cfg rename to test/units/modules/network/onyx/fixtures/onyx_interfaces_status.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_l2_interface_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_l2_interface_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_l2_interface_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_l2_interface_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_l3_interface_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_l3_interface_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_l3_interface_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_l3_interface_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_l3_vlan_interface_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_l3_vlan_interface_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_l3_vlan_interface_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_l3_vlan_interface_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_lldp_interface_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_lldp_interface_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_lldp_interface_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_lldp_interface_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_lldp_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_lldp_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_lldp_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_lldp_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_magp_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_magp_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_magp_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_magp_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_mlag_ipl_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_mlag_ipl_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_mlag_ipl_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_mlag_ipl_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_mlag_port_channel_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_mlag_port_channel_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_mlag_port_channel_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_mlag_port_channel_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_mlag_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_mlag_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_mlag_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_mlag_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_mlag_vip_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_mlag_vip_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_mlag_vip_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_mlag_vip_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_ospf_interfaces_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_ospf_interfaces_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_ospf_interfaces_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_ospf_interfaces_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_ospf_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_ospf_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_ospf_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_ospf_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_pfc_interface_disabled.cfg b/test/units/modules/network/onyx/fixtures/onyx_pfc_interface_disabled.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_pfc_interface_disabled.cfg rename to test/units/modules/network/onyx/fixtures/onyx_pfc_interface_disabled.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_pfc_interface_enabled.cfg b/test/units/modules/network/onyx/fixtures/onyx_pfc_interface_enabled.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_pfc_interface_enabled.cfg rename to test/units/modules/network/onyx/fixtures/onyx_pfc_interface_enabled.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_port_channel_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_port_channel_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_port_channel_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_port_channel_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_protocols_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_protocols_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_protocols_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_protocols_show.cfg diff --git a/test/units/modules/network/mlnxos/fixtures/mlnxos_vlan_show.cfg b/test/units/modules/network/onyx/fixtures/onyx_vlan_show.cfg similarity index 100% rename from test/units/modules/network/mlnxos/fixtures/mlnxos_vlan_show.cfg rename to test/units/modules/network/onyx/fixtures/onyx_vlan_show.cfg diff --git a/test/units/modules/network/mlnxos/mlnxos_module.py b/test/units/modules/network/onyx/onyx_module.py similarity index 98% rename from test/units/modules/network/mlnxos/mlnxos_module.py rename to test/units/modules/network/onyx/onyx_module.py index 48d416a3b9..2234ae5f0d 100644 --- a/test/units/modules/network/mlnxos/mlnxos_module.py +++ b/test/units/modules/network/onyx/onyx_module.py @@ -46,7 +46,7 @@ def load_fixture(name): return data -class TestMlnxosModule(ModuleTestCase): +class TestOnyxModule(ModuleTestCase): def execute_module(self, failed=False, changed=False, commands=None, is_updates=False, sort=True, transport='cli'): diff --git a/test/units/modules/network/mlnxos/test_mlnxos_bgp.py b/test/units/modules/network/onyx/test_onyx_bgp.py similarity index 87% rename from test/units/modules/network/mlnxos/test_mlnxos_bgp.py rename to test/units/modules/network/onyx/test_onyx_bgp.py index 1f1a3cd9d7..e110584f69 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_bgp.py +++ b/test/units/modules/network/onyx/test_onyx_bgp.py @@ -7,32 +7,32 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_bgp +from ansible.modules.network.onyx import onyx_bgp from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosBgpModule(TestMlnxosModule): +class TestOnyxBgpModule(TestOnyxModule): - module = mlnxos_bgp + module = onyx_bgp def setUp(self): - super(TestMlnxosBgpModule, self).setUp() + super(TestOnyxBgpModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_bgp.MlnxosBgpModule, "_get_bgp_summary") + onyx_bgp.OnyxBgpModule, "_get_bgp_summary") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosBgpModule, self).tearDown() + super(TestOnyxBgpModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): - config_file = 'mlnxos_bgp_show.cfg' + config_file = 'onyx_bgp_show.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_command.py b/test/units/modules/network/onyx/test_onyx_command.py similarity index 81% rename from test/units/modules/network/mlnxos/test_mlnxos_command.py rename to test/units/modules/network/onyx/test_onyx_command.py index 55a0948afa..e3d88effb0 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_command.py +++ b/test/units/modules/network/onyx/test_onyx_command.py @@ -22,23 +22,23 @@ __metaclass__ = type import json from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_command +from ansible.modules.network.onyx import onyx_command from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosCommandModule(TestMlnxosModule): +class TestOnyxCommandModule(TestOnyxModule): - module = mlnxos_command + module = onyx_command def setUp(self): - super(TestMlnxosCommandModule, self).setUp() + super(TestOnyxCommandModule, self).setUp() self.mock_run_commands = patch( - 'ansible.modules.network.mlnxos.mlnxos_command.run_commands') + 'ansible.modules.network.onyx.onyx_command.run_commands') self.run_commands = self.mock_run_commands.start() def tearDown(self): - super(TestMlnxosCommandModule, self).tearDown() + super(TestOnyxCommandModule, self).tearDown() self.mock_run_commands.stop() def load_fixtures(self, commands=None, transport='cli'): @@ -53,43 +53,43 @@ class TestMlnxosCommandModule(TestMlnxosModule): except ValueError: command = item['command'] filename = str(command).replace(' ', '_') - filename = 'mlnxos_command_%s.txt' % filename + filename = 'onyx_command_%s.txt' % filename output.append(load_fixture(filename)) return output self.run_commands.side_effect = load_from_file - def test_mlnxos_command_simple(self): + def test_onyx_command_simple(self): set_module_args(dict(commands=['show version'])) result = self.execute_module() self.assertEqual(len(result['stdout']), 1) self.assertTrue(result['stdout'][0].startswith('Product name')) - def test_mlnxos_command_multiple(self): + def test_onyx_command_multiple(self): set_module_args(dict(commands=['show version', 'show version'])) result = self.execute_module() self.assertEqual(len(result['stdout']), 2) self.assertTrue(result['stdout'][0].startswith('Product name')) - def test_mlnxos_command_wait_for(self): + def test_onyx_command_wait_for(self): wait_for = 'result[0] contains "MLNX"' set_module_args(dict(commands=['show version'], wait_for=wait_for)) self.execute_module() - def test_mlnxos_command_wait_for_fails(self): + def test_onyx_command_wait_for_fails(self): wait_for = 'result[0] contains "test string"' set_module_args(dict(commands=['show version'], wait_for=wait_for)) self.execute_module(failed=True) self.assertEqual(self.run_commands.call_count, 10) - def test_mlnxos_command_retries(self): + def test_onyx_command_retries(self): wait_for = 'result[0] contains "test string"' set_module_args( dict(commands=['show version'], wait_for=wait_for, retries=2)) self.execute_module(failed=True) self.assertEqual(self.run_commands.call_count, 2) - def test_mlnxos_command_match_any(self): + def test_onyx_command_match_any(self): wait_for = ['result[0] contains "MLNX"', 'result[0] contains "test string"'] set_module_args(dict( @@ -98,14 +98,14 @@ class TestMlnxosCommandModule(TestMlnxosModule): match='any')) self.execute_module() - def test_mlnxos_command_match_all(self): + def test_onyx_command_match_all(self): wait_for = ['result[0] contains "MLNX"', 'result[0] contains "Version summary"'] set_module_args( dict(commands=['show version'], wait_for=wait_for, match='all')) self.execute_module() - def test_mlnxos_command_match_all_failure(self): + def test_onyx_command_match_all_failure(self): wait_for = ['result[0] contains "MLNX"', 'result[0] contains "test string"'] commands = ['show version', 'show version'] diff --git a/test/units/modules/network/mlnxos/test_mlnxos_config.py b/test/units/modules/network/onyx/test_onyx_config.py similarity index 76% rename from test/units/modules/network/mlnxos/test_mlnxos_config.py rename to test/units/modules/network/onyx/test_onyx_config.py index 243346f48d..018b01b3de 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_config.py +++ b/test/units/modules/network/onyx/test_onyx_config.py @@ -21,56 +21,56 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_config +from ansible.modules.network.onyx import onyx_config from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosConfigModule(TestMlnxosModule): +class TestOnyxConfigModule(TestOnyxModule): - module = mlnxos_config + module = onyx_config def setUp(self): - super(TestMlnxosConfigModule, self).setUp() + super(TestOnyxConfigModule, self).setUp() - self.mock_get_config = patch('ansible.modules.network.mlnxos.mlnxos_config.get_config') + self.mock_get_config = patch('ansible.modules.network.onyx.onyx_config.get_config') self.get_config = self.mock_get_config.start() - self.mock_load_config = patch('ansible.modules.network.mlnxos.mlnxos_config.load_config') + self.mock_load_config = patch('ansible.modules.network.onyx.onyx_config.load_config') self.load_config = self.mock_load_config.start() - self.mock_run_commands = patch('ansible.modules.network.mlnxos.mlnxos_config.run_commands') + self.mock_run_commands = patch('ansible.modules.network.onyx.onyx_config.run_commands') self.run_commands = self.mock_run_commands.start() def tearDown(self): - super(TestMlnxosConfigModule, self).tearDown() + super(TestOnyxConfigModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() self.mock_run_commands.stop() def load_fixtures(self, commands=None, transport='cli'): - config_file = 'mlnxos_config_config.cfg' + config_file = 'onyx_config_config.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None - def test_mlnxos_config_unchanged(self): - src = load_fixture('mlnxos_config_config.cfg') + def test_onyx_config_unchanged(self): + src = load_fixture('onyx_config_config.cfg') set_module_args(dict(src=src)) self.execute_module() - def test_mlnxos_config_src(self): - src = load_fixture('mlnxos_config_src.cfg') + def test_onyx_config_src(self): + src = load_fixture('onyx_config_src.cfg') set_module_args(dict(src=src)) commands = [ 'interface mlag-port-channel 2'] self.execute_module(changed=True, commands=commands, is_updates=True) - def test_mlnxos_config_backup(self): + def test_onyx_config_backup(self): set_module_args(dict(backup=True)) result = self.execute_module() self.assertIn('__backup__', result) - def test_mlnxos_config_save(self): + def test_onyx_config_save(self): set_module_args(dict(save='yes')) self.execute_module(changed=True) self.assertEqual(self.run_commands.call_count, 1) @@ -79,35 +79,35 @@ class TestMlnxosConfigModule(TestMlnxosModule): args = self.run_commands.call_args[0][1] self.assertIn('configuration write', args) - def test_mlnxos_config_lines_wo_parents(self): + def test_onyx_config_lines_wo_parents(self): set_module_args(dict(lines=['hostname foo'])) commands = ['hostname foo'] self.execute_module(changed=True, commands=commands, is_updates=True) - def test_mlnxos_config_before(self): + def test_onyx_config_before(self): set_module_args(dict(lines=['hostname foo'], before=['test1', 'test2'])) commands = ['test1', 'test2', 'hostname foo'] self.execute_module(changed=True, commands=commands, sort=False, is_updates=True) - def test_mlnxos_config_after(self): + def test_onyx_config_after(self): set_module_args(dict(lines=['hostname foo'], after=['test1', 'test2'])) commands = ['hostname foo', 'test1', 'test2'] self.execute_module(changed=True, commands=commands, sort=False, is_updates=True) - def test_mlnxos_config_before_after(self): + def test_onyx_config_before_after(self): set_module_args(dict(lines=['hostname foo'], before=['test1', 'test2'], after=['test3', 'test4'])) commands = ['test1', 'test2', 'hostname foo', 'test3', 'test4'] self.execute_module(changed=True, commands=commands, sort=False, is_updates=True) - def test_mlnxos_config_config(self): + def test_onyx_config_config(self): config = 'hostname localhost' set_module_args(dict(lines=['hostname router'], config=config)) commands = ['hostname router'] self.execute_module(changed=True, commands=commands, is_updates=True) - def test_mlnxos_config_match_none(self): + def test_onyx_config_match_none(self): lines = ['hostname router'] set_module_args(dict(lines=lines, match='none')) self.execute_module(changed=True, commands=lines, is_updates=True) diff --git a/test/units/modules/network/mlnxos/test_mlnxos_facts.py b/test/units/modules/network/onyx/test_onyx_facts.py similarity index 77% rename from test/units/modules/network/mlnxos/test_mlnxos_facts.py rename to test/units/modules/network/onyx/test_onyx_facts.py index 02200b6fe0..7a9c1a13c8 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_facts.py +++ b/test/units/modules/network/onyx/test_onyx_facts.py @@ -8,23 +8,23 @@ __metaclass__ = type from ansible.compat.tests.mock import patch from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture -from ansible.modules.network.mlnxos import mlnxos_facts +from .onyx_module import TestOnyxModule, load_fixture +from ansible.modules.network.onyx import onyx_facts -class TestMlnxosFacts(TestMlnxosModule): +class TestOnyxFacts(TestOnyxModule): - module = mlnxos_facts + module = onyx_facts def setUp(self): - super(TestMlnxosFacts, self).setUp() + super(TestOnyxFacts, self).setUp() self.mock_run_command = patch.object( - mlnxos_facts.FactsBase, "_show_cmd") + onyx_facts.FactsBase, "_show_cmd") self.run_command = self.mock_run_command.start() def tearDown(self): - super(TestMlnxosFacts, self).tearDown() + super(TestOnyxFacts, self).tearDown() self.mock_run_command.stop() @@ -32,7 +32,7 @@ class TestMlnxosFacts(TestMlnxosModule): def load_from_file(*args, **kwargs): command = args[0] - filename = "mlnxos_facts_%s.cfg" % command + filename = "onyx_facts_%s.cfg" % command filename = filename.replace(' ', '_') filename = filename.replace('/', '7') output = load_fixture(filename) @@ -40,7 +40,7 @@ class TestMlnxosFacts(TestMlnxosModule): self.run_command.side_effect = load_from_file - def test_mlnxos_facts_version(self): + def test_onyx_facts_version(self): set_module_args(dict(gather_subset='version')) result = self.execute_module() facts = result.get('ansible_facts') @@ -48,7 +48,7 @@ class TestMlnxosFacts(TestMlnxosModule): version = facts['ansible_net_version'] self.assertEqual(version['Product name'], 'MLNX-OS') - def test_mlnxos_facts_modules(self): + def test_onyx_facts_modules(self): set_module_args(dict(gather_subset='modules')) result = self.execute_module() facts = result.get('ansible_facts') @@ -56,7 +56,7 @@ class TestMlnxosFacts(TestMlnxosModule): modules = facts['ansible_net_modules'] self.assertIn("MGMT", modules) - def test_mlnxos_facts_interfaces(self): + def test_onyx_facts_interfaces(self): set_module_args(dict(gather_subset='interfaces')) result = self.execute_module() facts = result.get('ansible_facts') @@ -64,7 +64,7 @@ class TestMlnxosFacts(TestMlnxosModule): interfaces = facts['ansible_net_interfaces'] self.assertEqual(len(interfaces), 2) - def test_mlnxos_facts_all(self): + def test_onyx_facts_all(self): set_module_args(dict(gather_subset='all')) result = self.execute_module() facts = result.get('ansible_facts') diff --git a/test/units/modules/network/mlnxos/test_mlnxos_interface.py b/test/units/modules/network/onyx/test_onyx_interface.py similarity index 82% rename from test/units/modules/network/mlnxos/test_mlnxos_interface.py rename to test/units/modules/network/onyx/test_onyx_interface.py index a5d7d4df2e..a8a92070c6 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_interface.py +++ b/test/units/modules/network/onyx/test_onyx_interface.py @@ -7,40 +7,40 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_interface +from ansible.modules.network.onyx import onyx_interface from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosInterfaceModule(TestMlnxosModule): +class TestOnyxInterfaceModule(TestOnyxModule): - module = mlnxos_interface + module = onyx_interface def setUp(self): - super(TestMlnxosInterfaceModule, self).setUp() + super(TestOnyxInterfaceModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_interface.MlnxosInterfaceModule, "_get_interfaces_config") + onyx_interface.OnyxInterfaceModule, "_get_interfaces_config") self.get_config = self.mock_get_config.start() self.mock_get_interfaces_status = patch.object( - mlnxos_interface.MlnxosInterfaceModule, "_get_interfaces_status") + onyx_interface.OnyxInterfaceModule, "_get_interfaces_status") self.get_interfaces_status = self.mock_get_interfaces_status.start() self.mock_get_interfaces_rates = patch.object( - mlnxos_interface.MlnxosInterfaceModule, "_get_interfaces_rates") + onyx_interface.OnyxInterfaceModule, "_get_interfaces_rates") self.get_interfaces_rates = self.mock_get_interfaces_rates.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosInterfaceModule, self).tearDown() + super(TestOnyxInterfaceModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): - config_file = 'mlnxos_interfaces_show.cfg' + config_file = 'onyx_interfaces_show.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None @@ -97,24 +97,24 @@ class TestMlnxosInterfaceModule(TestMlnxosModule): def test_oper_state_check(self): set_module_args(dict(name='Eth1/1', enabled=True, state='down')) - config_file = 'mlnxos_interfaces_status.cfg' + config_file = 'onyx_interfaces_status.cfg' self.get_interfaces_status.return_value = load_fixture(config_file) self.execute_module(changed=False) def test_vlan_oper_state_check(self): set_module_args(dict(name='Vlan 1002', state='down')) - config_file = 'mlnxos_interfaces_status.cfg' + config_file = 'onyx_interfaces_status.cfg' self.get_interfaces_status.return_value = load_fixture(config_file) self.execute_module(changed=False) def test_rx_rate_check(self): set_module_args(dict(name='Eth1/1', enabled=True, rx_rate='ge(9000)')) - config_file = 'mlnxos_interfaces_rates.cfg' + config_file = 'onyx_interfaces_rates.cfg' self.get_interfaces_rates.return_value = load_fixture(config_file) self.execute_module(changed=False) def test_tx_rate_check(self): set_module_args(dict(name='Eth1/1', enabled=True, tx_rate='ge(10000)')) - config_file = 'mlnxos_interfaces_rates.cfg' + config_file = 'onyx_interfaces_rates.cfg' self.get_interfaces_rates.return_value = load_fixture(config_file) self.execute_module(changed=False) diff --git a/test/units/modules/network/mlnxos/test_mlnxos_l2_interface.py b/test/units/modules/network/onyx/test_onyx_l2_interface.py similarity index 89% rename from test/units/modules/network/mlnxos/test_mlnxos_l2_interface.py rename to test/units/modules/network/onyx/test_onyx_l2_interface.py index 2a926daa8c..71e331c777 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_l2_interface.py +++ b/test/units/modules/network/onyx/test_onyx_l2_interface.py @@ -21,32 +21,32 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_l2_interface +from ansible.modules.network.onyx import onyx_l2_interface from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosInterfaceModule(TestMlnxosModule): +class TestOnyxInterfaceModule(TestOnyxModule): - module = mlnxos_l2_interface + module = onyx_l2_interface def setUp(self): - super(TestMlnxosInterfaceModule, self).setUp() + super(TestOnyxInterfaceModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_l2_interface.MlnxosL2InterfaceModule, "_get_switchport_config") + onyx_l2_interface.OnyxL2InterfaceModule, "_get_switchport_config") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosInterfaceModule, self).tearDown() + super(TestOnyxInterfaceModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): - config_file = 'mlnxos_l2_interface_show.cfg' + config_file = 'onyx_l2_interface_show.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_l3_interface.py b/test/units/modules/network/onyx/test_onyx_l3_interface.py similarity index 86% rename from test/units/modules/network/mlnxos/test_mlnxos_l3_interface.py rename to test/units/modules/network/onyx/test_onyx_l3_interface.py index 075830c4db..839f7b3c6d 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_l3_interface.py +++ b/test/units/modules/network/onyx/test_onyx_l3_interface.py @@ -7,28 +7,28 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_l3_interface +from ansible.modules.network.onyx import onyx_l3_interface from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosL3InterfaceModule(TestMlnxosModule): +class TestOnyxL3InterfaceModule(TestOnyxModule): - module = mlnxos_l3_interface + module = onyx_l3_interface def setUp(self): - super(TestMlnxosL3InterfaceModule, self).setUp() + super(TestOnyxL3InterfaceModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_l3_interface.MlnxosL3InterfaceModule, + onyx_l3_interface.OnyxL3InterfaceModule, "_get_interfaces_config") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosL3InterfaceModule, self).tearDown() + super(TestOnyxL3InterfaceModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() @@ -54,11 +54,11 @@ class TestMlnxosL3InterfaceModule(TestMlnxosModule): self.load_config.return_value = None def load_eth_ifc_fixture(self): - config_file = 'mlnxos_l3_interface_show.cfg' + config_file = 'onyx_l3_interface_show.cfg' self.load_fixture(config_file) def load_vlan_ifc_fixture(self): - config_file = 'mlnxos_l3_vlan_interface_show.cfg' + config_file = 'onyx_l3_vlan_interface_show.cfg' self.load_fixture(config_file) def test_vlan_ifc_no_change(self): diff --git a/test/units/modules/network/mlnxos/test_mlnxos_linkagg.py b/test/units/modules/network/onyx/test_onyx_linkagg.py similarity index 88% rename from test/units/modules/network/mlnxos/test_mlnxos_linkagg.py rename to test/units/modules/network/onyx/test_onyx_linkagg.py index 88e31607a0..864e7dd030 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_linkagg.py +++ b/test/units/modules/network/onyx/test_onyx_linkagg.py @@ -7,28 +7,28 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_linkagg +from ansible.modules.network.onyx import onyx_linkagg from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosLinkaggModule(TestMlnxosModule): +class TestOnyxLinkaggModule(TestOnyxModule): - module = mlnxos_linkagg + module = onyx_linkagg def setUp(self): - super(TestMlnxosLinkaggModule, self).setUp() + super(TestOnyxLinkaggModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_linkagg.MlnxosLinkAggModule, + onyx_linkagg.OnyxLinkAggModule, "_get_port_channels") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosLinkaggModule, self).tearDown() + super(TestOnyxLinkaggModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() @@ -37,11 +37,11 @@ class TestMlnxosLinkaggModule(TestMlnxosModule): self.load_config.return_value = None def load_port_channel_fixture(self): - config_file = 'mlnxos_port_channel_show.cfg' + config_file = 'onyx_port_channel_show.cfg' self.load_fixture(config_file) def load_mlag_port_channel_fixture(self): - config_file = 'mlnxos_mlag_port_channel_show.cfg' + config_file = 'onyx_mlag_port_channel_show.cfg' self.load_fixture(config_file) def test_port_channel_no_change(self): diff --git a/test/units/modules/network/mlnxos/test_mlnxos_lldp.py b/test/units/modules/network/onyx/test_onyx_lldp.py similarity index 77% rename from test/units/modules/network/mlnxos/test_mlnxos_lldp.py rename to test/units/modules/network/onyx/test_onyx_lldp.py index 2d2c2306e9..69084176fe 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_lldp.py +++ b/test/units/modules/network/onyx/test_onyx_lldp.py @@ -23,28 +23,27 @@ __metaclass__ = type import json from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_lldp -from ansible.module_utils.network.mlnxos import mlnxos as mlnxos_utils +from ansible.modules.network.onyx import onyx_lldp from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosInterfaceModule(TestMlnxosModule): +class TestOnyxInterfaceModule(TestOnyxModule): - module = mlnxos_lldp + module = onyx_lldp def setUp(self): - super(TestMlnxosInterfaceModule, self).setUp() + super(TestOnyxInterfaceModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_lldp.MlnxosLldpModule, "_get_lldp_config") + onyx_lldp.OnyxLldpModule, "_get_lldp_config") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosInterfaceModule, self).tearDown() + super(TestOnyxInterfaceModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() @@ -52,7 +51,7 @@ class TestMlnxosInterfaceModule(TestMlnxosModule): if commands == ['lldp']: self.get_config.return_value = None else: - config_file = 'mlnxos_lldp_show.cfg' + config_file = 'onyx_lldp_show.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_lldp_interface.py b/test/units/modules/network/onyx/test_onyx_lldp_interface.py similarity index 83% rename from test/units/modules/network/mlnxos/test_mlnxos_lldp_interface.py rename to test/units/modules/network/onyx/test_onyx_lldp_interface.py index c7be9f4eaf..4cbf9f4bbc 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_lldp_interface.py +++ b/test/units/modules/network/onyx/test_onyx_lldp_interface.py @@ -7,33 +7,33 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_lldp_interface +from ansible.modules.network.onyx import onyx_lldp_interface from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosLldpInterfaceModule(TestMlnxosModule): +class TestOnyxLldpInterfaceModule(TestOnyxModule): - module = mlnxos_lldp_interface + module = onyx_lldp_interface def setUp(self): - super(TestMlnxosLldpInterfaceModule, self).setUp() + super(TestOnyxLldpInterfaceModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_lldp_interface.MlnxosLldpInterfaceModule, + onyx_lldp_interface.OnyxLldpInterfaceModule, "_get_lldp_config") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosLldpInterfaceModule, self).tearDown() + super(TestOnyxLldpInterfaceModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): - config_file = 'mlnxos_lldp_interface_show.cfg' + config_file = 'onyx_lldp_interface_show.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_magp.py b/test/units/modules/network/onyx/test_onyx_magp.py similarity index 89% rename from test/units/modules/network/mlnxos/test_mlnxos_magp.py rename to test/units/modules/network/onyx/test_onyx_magp.py index d27cd67113..d63a377005 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_magp.py +++ b/test/units/modules/network/onyx/test_onyx_magp.py @@ -7,33 +7,33 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_magp +from ansible.modules.network.onyx import onyx_magp from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosMagpModule(TestMlnxosModule): +class TestOnyxMagpModule(TestOnyxModule): - module = mlnxos_magp + module = onyx_magp def setUp(self): - super(TestMlnxosMagpModule, self).setUp() + super(TestOnyxMagpModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_magp.MlnxosMagpModule, + onyx_magp.OnyxMagpModule, "_get_magp_config") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosMagpModule, self).tearDown() + super(TestOnyxMagpModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): - config_file = 'mlnxos_magp_show.cfg' + config_file = 'onyx_magp_show.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_mlag_ipl.py b/test/units/modules/network/onyx/test_onyx_mlag_ipl.py similarity index 85% rename from test/units/modules/network/mlnxos/test_mlnxos_mlag_ipl.py rename to test/units/modules/network/onyx/test_onyx_mlag_ipl.py index 0a18980b53..2a88644ffc 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_mlag_ipl.py +++ b/test/units/modules/network/onyx/test_onyx_mlag_ipl.py @@ -7,35 +7,35 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_mlag_ipl +from ansible.modules.network.onyx import onyx_mlag_ipl from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosMlagIplModule(TestMlnxosModule): +class TestOnyxMlagIplModule(TestOnyxModule): - module = mlnxos_mlag_ipl + module = onyx_mlag_ipl def setUp(self): - super(TestMlnxosMlagIplModule, self).setUp() + super(TestOnyxMlagIplModule, self).setUp() self._mlag_enabled = True self.mock_get_config = patch.object( - mlnxos_mlag_ipl.MlnxosMlagIplModule, + onyx_mlag_ipl.OnyxMlagIplModule, "_show_mlag_data") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosMlagIplModule, self).tearDown() + super(TestOnyxMlagIplModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): if self._mlag_enabled: - config_file = 'mlnxos_mlag_ipl_show.cfg' + config_file = 'onyx_mlag_ipl_show.cfg' self.get_config.return_value = load_fixture(config_file) else: self.get_config.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_mlag_vip.py b/test/units/modules/network/onyx/test_onyx_mlag_vip.py similarity index 80% rename from test/units/modules/network/mlnxos/test_mlnxos_mlag_vip.py rename to test/units/modules/network/onyx/test_onyx_mlag_vip.py index c0bee88fb1..87acff617f 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_mlag_vip.py +++ b/test/units/modules/network/onyx/test_onyx_mlag_vip.py @@ -7,42 +7,42 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_mlag_vip +from ansible.modules.network.onyx import onyx_mlag_vip from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosMlagVipModule(TestMlnxosModule): +class TestOnyxMlagVipModule(TestOnyxModule): - module = mlnxos_mlag_vip + module = onyx_mlag_vip def setUp(self): - super(TestMlnxosMlagVipModule, self).setUp() + super(TestOnyxMlagVipModule, self).setUp() self._mlag_enabled = True self.mock_show_mlag = patch.object( - mlnxos_mlag_vip.MlnxosMLagVipModule, + onyx_mlag_vip.OnyxMLagVipModule, "_show_mlag") self.show_mlag = self.mock_show_mlag.start() self.mock_show_mlag_vip = patch.object( - mlnxos_mlag_vip.MlnxosMLagVipModule, + onyx_mlag_vip.OnyxMLagVipModule, "_show_mlag_vip") self.show_mlag_vip = self.mock_show_mlag_vip.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosMlagVipModule, self).tearDown() + super(TestOnyxMlagVipModule, self).tearDown() self.mock_show_mlag.stop() self.mock_show_mlag_vip.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): if self._mlag_enabled: - config_file = 'mlnxos_mlag_vip_show.cfg' + config_file = 'onyx_mlag_vip_show.cfg' self.show_mlag_vip.return_value = load_fixture(config_file) - config_file = 'mlnxos_mlag_show.cfg' + config_file = 'onyx_mlag_show.cfg' self.show_mlag.return_value = load_fixture(config_file) else: self.show_mlag_vip.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_ospf.py b/test/units/modules/network/onyx/test_onyx_ospf.py similarity index 87% rename from test/units/modules/network/mlnxos/test_mlnxos_ospf.py rename to test/units/modules/network/onyx/test_onyx_ospf.py index 7383e2817f..f50f41c472 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_ospf.py +++ b/test/units/modules/network/onyx/test_onyx_ospf.py @@ -7,42 +7,42 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_ospf +from ansible.modules.network.onyx import onyx_ospf from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosOspfModule(TestMlnxosModule): +class TestOnyxOspfModule(TestOnyxModule): - module = mlnxos_ospf + module = onyx_ospf def setUp(self): - super(TestMlnxosOspfModule, self).setUp() + super(TestOnyxOspfModule, self).setUp() self._ospf_exists = True self.mock_get_config = patch.object( - mlnxos_ospf.MlnxosOspfModule, + onyx_ospf.OnyxOspfModule, "_get_ospf_config") self.get_config = self.mock_get_config.start() self.mock_get_interfaces_config = patch.object( - mlnxos_ospf.MlnxosOspfModule, + onyx_ospf.OnyxOspfModule, "_get_ospf_interfaces_config") self.get_interfaces_config = self.mock_get_interfaces_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosOspfModule, self).tearDown() + super(TestOnyxOspfModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): if self._ospf_exists: - config_file = 'mlnxos_ospf_show.cfg' + config_file = 'onyx_ospf_show.cfg' self.get_config.return_value = load_fixture(config_file) - config_file = 'mlnxos_ospf_interfaces_show.cfg' + config_file = 'onyx_ospf_interfaces_show.cfg' self.get_interfaces_config.return_value = load_fixture(config_file) else: self.get_config.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_pfc_interface.py b/test/units/modules/network/onyx/test_onyx_pfc_interface.py similarity index 87% rename from test/units/modules/network/mlnxos/test_mlnxos_pfc_interface.py rename to test/units/modules/network/onyx/test_onyx_pfc_interface.py index d64fd5b0ff..670d416a50 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_pfc_interface.py +++ b/test/units/modules/network/onyx/test_onyx_pfc_interface.py @@ -7,29 +7,29 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_pfc_interface +from ansible.modules.network.onyx import onyx_pfc_interface from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosPfcInterfaceModule(TestMlnxosModule): +class TestOnyxPfcInterfaceModule(TestOnyxModule): - module = mlnxos_pfc_interface + module = onyx_pfc_interface def setUp(self): - super(TestMlnxosPfcInterfaceModule, self).setUp() + super(TestOnyxPfcInterfaceModule, self).setUp() self._pfc_enabled = True self.mock_get_config = patch.object( - mlnxos_pfc_interface.MlnxosPfcInterfaceModule, + onyx_pfc_interface.OnyxPfcInterfaceModule, "_get_pfc_config") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosPfcInterfaceModule, self).tearDown() + super(TestOnyxPfcInterfaceModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() @@ -38,7 +38,7 @@ class TestMlnxosPfcInterfaceModule(TestMlnxosModule): suffix = 'enabled' else: suffix = 'disabled' - config_file = 'mlnxos_pfc_interface_%s.cfg' % suffix + config_file = 'onyx_pfc_interface_%s.cfg' % suffix self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None diff --git a/test/units/modules/network/mlnxos/test_mlnxos_protocols.py b/test/units/modules/network/onyx/test_onyx_protocols.py similarity index 88% rename from test/units/modules/network/mlnxos/test_mlnxos_protocols.py rename to test/units/modules/network/onyx/test_onyx_protocols.py index ad818c256e..cc873eead1 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_protocols.py +++ b/test/units/modules/network/onyx/test_onyx_protocols.py @@ -7,38 +7,38 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_protocol +from ansible.modules.network.onyx import onyx_protocol from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosProtocolModule(TestMlnxosModule): +class TestOnyxProtocolModule(TestOnyxModule): - module = mlnxos_protocol + module = onyx_protocol def setUp(self): - super(TestMlnxosProtocolModule, self).setUp() + super(TestOnyxProtocolModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_protocol.MlnxosProtocolModule, + onyx_protocol.OnyxProtocolModule, "_get_protocols") self.get_config = self.mock_get_config.start() self.mock_get_ip_config = patch.object( - mlnxos_protocol.MlnxosProtocolModule, + onyx_protocol.OnyxProtocolModule, "_get_ip_routing") self.get_ip_config = self.mock_get_ip_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosProtocolModule, self).tearDown() + super(TestOnyxProtocolModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): - config_file = 'mlnxos_protocols_show.cfg' + config_file = 'onyx_protocols_show.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None self.get_ip_config.return_value = "IP routing: enabled" diff --git a/test/units/modules/network/mlnxos/test_mlnxos_vlan.py b/test/units/modules/network/onyx/test_onyx_vlan.py similarity index 86% rename from test/units/modules/network/mlnxos/test_mlnxos_vlan.py rename to test/units/modules/network/onyx/test_onyx_vlan.py index c9ac02aa40..3e8f59e219 100644 --- a/test/units/modules/network/mlnxos/test_mlnxos_vlan.py +++ b/test/units/modules/network/onyx/test_onyx_vlan.py @@ -23,33 +23,32 @@ __metaclass__ = type import json from ansible.compat.tests.mock import patch -from ansible.modules.network.mlnxos import mlnxos_vlan -from ansible.module_utils.network.mlnxos import mlnxos as mlnxos_utils +from ansible.modules.network.onyx import onyx_vlan from units.modules.utils import set_module_args -from .mlnxos_module import TestMlnxosModule, load_fixture +from .onyx_module import TestOnyxModule, load_fixture -class TestMlnxosVlanModule(TestMlnxosModule): +class TestOnyxVlanModule(TestOnyxModule): - module = mlnxos_vlan + module = onyx_vlan def setUp(self): - super(TestMlnxosVlanModule, self).setUp() + super(TestOnyxVlanModule, self).setUp() self.mock_get_config = patch.object( - mlnxos_vlan.MlnxosVlanModule, "_get_vlan_config") + onyx_vlan.OnyxVlanModule, "_get_vlan_config") self.get_config = self.mock_get_config.start() self.mock_load_config = patch( - 'ansible.module_utils.network.mlnxos.mlnxos.load_config') + 'ansible.module_utils.network.onyx.onyx.load_config') self.load_config = self.mock_load_config.start() def tearDown(self): - super(TestMlnxosVlanModule, self).tearDown() + super(TestOnyxVlanModule, self).tearDown() self.mock_get_config.stop() self.mock_load_config.stop() def load_fixtures(self, commands=None, transport='cli'): - config_file = 'mlnxos_vlan_show.cfg' + config_file = 'onyx_vlan_show.cfg' self.get_config.return_value = load_fixture(config_file) self.load_config.return_value = None