Skip to content

Commit

Permalink
Fix import errors caused by ansible.netcommon 2.0.0 breaking changes (#…
Browse files Browse the repository at this point in the history
…531) (#533)

* Fix import errors caused by ansible.netcommon 2.0.0 breaking changes

* Add changelog fragment

(cherry picked from commit 448b6f8)

Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
  • Loading branch information
patchback[bot] and Andersson007 authored Mar 7, 2023
1 parent d7981e4 commit 3a75126
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/0-fix_imports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bugfixes:
- cnos_l3_interface - fix import errors (https://github.com/ansible-collections/community.network/pull/531).
- icx_l3_interface - fix import errors (https://github.com/ansible-collections/community.network/pull/531).
- slxos_l3_interface - fix import errors (https://github.com/ansible-collections/community.network/pull/531).
6 changes: 4 additions & 2 deletions plugins/modules/cnos_l3_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@
from ansible_collections.community.network.plugins.module_utils.network.cnos.cnos import run_commands
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.config import NetworkConfig
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import remove_default_spec
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import is_netmask, is_masklen
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import to_netmask, to_masklen
try:
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import is_netmask, is_masklen, to_netmask, to_masklen
except ImportError:
from ansible.module_utils.common.network import is_netmask, is_masklen, to_netmask, to_masklen


def validate_ipv4(value, module):
Expand Down
5 changes: 4 additions & 1 deletion plugins/modules/icx_l3_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@
from ansible_collections.community.network.plugins.module_utils.network.icx.icx import get_config, load_config
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.config import NetworkConfig
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import remove_default_spec
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import is_netmask, is_masklen, to_netmask, to_masklen
try:
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import is_netmask, is_masklen, to_netmask, to_masklen
except ImportError:
from ansible.module_utils.common.network import is_netmask, is_masklen, to_netmask, to_masklen


def validate_ipv4(value, module):
Expand Down
5 changes: 4 additions & 1 deletion plugins/modules/slxos_l3_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@
from ansible_collections.community.network.plugins.module_utils.network.slxos.slxos import get_config, load_config
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.config import NetworkConfig
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import conditional, remove_default_spec
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import is_netmask, is_masklen, to_netmask, to_masklen
try:
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import is_netmask, is_masklen, to_netmask, to_masklen
except ImportError:
from ansible.module_utils.common.network import is_netmask, is_masklen, to_netmask, to_masklen


def validate_ipv4(value, module):
Expand Down

0 comments on commit 3a75126

Please sign in to comment.