Skip to content

Commit 8176d1c

Browse files
Merge branch 'develop' of https://github.com/sivakasi-cisco/ansible-dc-vxlan into changes_for_nd_rest
2 parents fd26e1c + 01fa7d4 commit 8176d1c

File tree

176 files changed

+2214
-2000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+2214
-2000
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- name: Check out code
2727
uses: actions/checkout@v4
28-
28+
2929
- name: Set up Python 3.10.14
3030
uses: actions/setup-python@v5
3131
with:

plugins/action/common/nac_dc_validate.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,22 @@
2929
from ansible.errors import AnsibleError
3030

3131
try:
32-
from iac_validate.yaml import load_yaml_files
33-
import iac_validate.validator
34-
from iac_validate.cli.options import DEFAULT_SCHEMA
35-
except ImportError as imp_exc:
36-
IAC_VALIDATE_IMPORT_ERROR = imp_exc
32+
from nac_yaml.yaml import load_yaml_files
33+
except ImportError as imp_yaml_exc:
34+
NAC_YAML_IMPORT_ERROR = imp_yaml_exc
3735
else:
38-
IAC_VALIDATE_IMPORT_ERROR = None
36+
NAC_YAML_IMPORT_ERROR = None
37+
38+
try:
39+
import nac_validate.validator
40+
from nac_validate.cli.defaults import DEFAULT_SCHEMA
41+
except ImportError as imp_val_exc:
42+
NAC_VALIDATE_IMPORT_ERROR = imp_val_exc
43+
else:
44+
NAC_VALIDATE_IMPORT_ERROR = None
3945

4046
import os
41-
from ...plugin_utils.helper_functions import data_model_key_check
47+
from ansible_collections.cisco.nac_dc_vxlan.plugins.plugin_utils.helper_functions import data_model_key_check
4248

4349
display = Display()
4450

@@ -50,8 +56,11 @@ def run(self, tmp=None, task_vars=None):
5056
results['failed'] = False
5157
results['msg'] = None
5258

53-
if IAC_VALIDATE_IMPORT_ERROR:
54-
raise AnsibleError('iac-validate not found and must be installed. Please pip install iac-validate.') from IAC_VALIDATE_IMPORT_ERROR
59+
if NAC_YAML_IMPORT_ERROR:
60+
raise AnsibleError('nac-yaml not found and must be installed. Please pip install nac-yaml.') from NAC_YAML_IMPORT_ERROR
61+
62+
if NAC_VALIDATE_IMPORT_ERROR:
63+
raise AnsibleError('nac-validate not found and must be installed. Please pip install nac-validate.') from NAC_VALIDATE_IMPORT_ERROR
5564

5665
schema = self._task.args.get('schema')
5766
rules = self._task.args.get('rules')
@@ -134,7 +143,7 @@ def run(self, tmp=None, task_vars=None):
134143
rules_list.append(f'{rules}')
135144

136145
for rules_item in rules_list:
137-
validator = iac_validate.validator.Validator(schema, rules_item)
146+
validator = nac_validate.validator.Validator(schema, rules_item)
138147
if schema:
139148
validator.validate_syntax([mdata])
140149
if rules_item:

plugins/action/common/prepare_plugins/prep_001_fabric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# SPDX-License-Identifier: MIT
2121

2222
from ansible.utils.display import Display
23-
from ....plugin_utils.helper_functions import data_model_key_check
23+
from ansible_collections.cisco.nac_dc_vxlan.plugins.plugin_utils.helper_functions import data_model_key_check
2424

2525
display = Display()
2626

plugins/action/common/prepare_plugins/prep_002_list_defaults.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# SPDX-License-Identifier: MIT
2121

2222
from ansible.utils.display import Display
23-
from ....plugin_utils.helper_functions import data_model_key_check
24-
from ....plugin_utils.data_model_keys import model_keys
23+
from ansible_collections.cisco.nac_dc_vxlan.plugins.plugin_utils.helper_functions import data_model_key_check
24+
from ansible_collections.cisco.nac_dc_vxlan.plugins.plugin_utils.data_model_keys import model_keys
2525
from functools import reduce
2626
import operator
2727

plugins/action/common/prepare_plugins/prep_103_topology_switches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#
2020
# SPDX-License-Identifier: MIT
2121

22-
from ....plugin_utils.helper_functions import hostname_to_ip_mapping, data_model_key_check
22+
from ansible_collections.cisco.nac_dc_vxlan.plugins.plugin_utils.helper_functions import hostname_to_ip_mapping, data_model_key_check
2323

2424

2525
class PreparePlugin:

plugins/action/common/prepare_plugins/prep_104_fabric_overlay.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
#
2020
# SPDX-License-Identifier: MIT
2121

22-
# from ....plugin_utils.helper_functions import data_model_key_check
23-
24-
2522
class PreparePlugin:
2623
def __init__(self, **kwargs):
2724
self.kwargs = kwargs

plugins/action/common/prepare_plugins/prep_105_topology_interfaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#
2020
# SPDX-License-Identifier: MIT
2121

22-
2322
# Count interfaces of different types and expose in extended service model for controls within playbooks
2423
#
24+
2525
class PreparePlugin:
2626
def __init__(self, **kwargs):
2727
self.kwargs = kwargs

plugins/action/common/prepare_plugins/prep_107_vrf_lites.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# SPDX-License-Identifier: MIT
2121

2222
from jinja2 import ChainableUndefined, Environment, FileSystemLoader
23-
from ....plugin_utils.helper_functions import hostname_to_ip_mapping
23+
from ansible_collections.cisco.nac_dc_vxlan.plugins.plugin_utils.helper_functions import hostname_to_ip_mapping
2424
from ansible_collections.ansible.utils.plugins.filter import ipaddr
2525

2626

plugins/action/common/prepare_plugins/prep_108_route_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import re
2323
from jinja2 import ChainableUndefined, Environment, FileSystemLoader
2424
from ansible_collections.ansible.utils.plugins.filter import ipaddr, hwaddr
25-
from ....plugin_utils.helper_functions import hostname_to_ip_mapping, data_model_key_check
25+
from ansible_collections.cisco.nac_dc_vxlan.plugins.plugin_utils.helper_functions import hostname_to_ip_mapping, data_model_key_check
2626

2727

2828
class PreparePlugin:

plugins/action/common/prepare_plugins/prep_118_topology_edge_connections.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#
2020
# SPDX-License-Identifier: MIT
2121

22-
2322
class PreparePlugin:
2423
def __init__(self, **kwargs):
2524
self.kwargs = kwargs

0 commit comments

Comments
 (0)