nornir-collection 0.0.7__py3-none-any.whl → 0.0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nornir_collection/cisco/configuration_management/netconf/config_workflow.py +3 -5
- nornir_collection/cisco/configuration_management/restconf/config_workflow.py +2 -0
- nornir_collection/cisco/configuration_management/utils.py +2 -2
- nornir_collection/netbox/inventory.py +4 -0
- {nornir_collection-0.0.7.dist-info → nornir_collection-0.0.9.dist-info}/METADATA +1 -1
- {nornir_collection-0.0.7.dist-info → nornir_collection-0.0.9.dist-info}/RECORD +9 -9
- {nornir_collection-0.0.7.dist-info → nornir_collection-0.0.9.dist-info}/LICENSE +0 -0
- {nornir_collection-0.0.7.dist-info → nornir_collection-0.0.9.dist-info}/WHEEL +0 -0
- {nornir_collection-0.0.7.dist-info → nornir_collection-0.0.9.dist-info}/top_level.txt +0 -0
@@ -93,8 +93,8 @@ def _nc_commit_confirm_testing(nr: Task) -> bool:
|
|
93
93
|
print(task_name(text=task_text))
|
94
94
|
print(task_result(text=task_text, changed=False, level_name="INFO"))
|
95
95
|
print(f"'{task_text}' -> PythonResponse <Success: True>")
|
96
|
-
print("-> Sleep
|
97
|
-
time.sleep(
|
96
|
+
print("-> Sleep 60s seconds before run the Nornir TestsProcessor ...")
|
97
|
+
time.sleep(60)
|
98
98
|
|
99
99
|
# Run Nornir TestsProcessor for Unit, Integration, and System tests. All tests files with the inventory
|
100
100
|
# key starting with the prefix "cfgtp_{name}_" and are loaded from the inventory.
|
@@ -226,10 +226,8 @@ def nc_cfg_iosxe_netconf_config(
|
|
226
226
|
########################################### WORKAROUND ##################################################
|
227
227
|
# If its a commit-confirm and the cfg_status is True
|
228
228
|
if not disable_commit_confirm and cfg_status:
|
229
|
-
# Calculate the revert-timer in minutes from the confirm-timeout in seconds
|
230
|
-
revert_timer = confirm_timeout // 60
|
231
229
|
# Replace the config with a revert-timer right before the commit
|
232
|
-
cfg_status = rc_replace_config(nr=nr, rebuild=rebuild, verbose=verbose, revert_timer=
|
230
|
+
cfg_status = rc_replace_config(nr=nr, rebuild=rebuild, verbose=verbose, revert_timer=confirm_timeout)
|
233
231
|
#########################################################################################################
|
234
232
|
|
235
233
|
# Start a timer to check how long the commit takes.
|
@@ -37,6 +37,8 @@ def rc_replace_config(
|
|
37
37
|
|
38
38
|
# Set rollback_config to day0-config if rebuild is True, else set it to golden-config
|
39
39
|
rollback_config = "day0-config" if rebuild else "golden-config"
|
40
|
+
# Calculate the revert-timer in minutes from the input revert-timer in seconds
|
41
|
+
revert_timer = revert_timer // 60 if revert_timer else None
|
40
42
|
|
41
43
|
# Print the task title if revert_timer is not set
|
42
44
|
if not revert_timer:
|
@@ -356,8 +356,8 @@ def init_args_for_netconf_cm() -> argparse.Namespace:
|
|
356
356
|
"--confirm-timeout",
|
357
357
|
type=int,
|
358
358
|
metavar="<INT>",
|
359
|
-
default=
|
360
|
-
help="set NETCONF commit-confirm timeout in seconds (default:
|
359
|
+
default=120,
|
360
|
+
help="set NETCONF commit-confirm timeout in seconds (default: 120s)",
|
361
361
|
)
|
362
362
|
|
363
363
|
# Add the optional rebuild argument
|
@@ -170,6 +170,7 @@ def _load_vlan_data(task: Task, all_vlans: List[Dict]) -> Result:
|
|
170
170
|
vlans = []
|
171
171
|
for role in roles:
|
172
172
|
# Update the VLANs to match all VLANs that match also the role
|
173
|
+
# The following list comprehensions fails of the 'group' or the 'role' is None
|
173
174
|
data = [x for x in all_vlans if (x["group"]["name"] == group and x["role"]["name"] == role)]
|
174
175
|
vlans.extend(data)
|
175
176
|
# Return if the data list is empty
|
@@ -306,6 +307,9 @@ def load_additional_netbox_data(nr: Nornir, add_netbox_data: dict[str:bool]) ->
|
|
306
307
|
if add_netbox_data.get("load_vlan_data"):
|
307
308
|
# Get all vlans from NetBox
|
308
309
|
all_vlans = get_nb_resources(url=f"{nb_url}/api/ipam/vlans/?limit=1000?")
|
310
|
+
# The task _load_vlan_data can only load VLANs that are part of a group and have a role. All VLANs
|
311
|
+
# in the DSC Azure Tenant are not part of a group and needs to be excluded the the all_vlans list.
|
312
|
+
all_vlans = [x for x in all_vlans if x["role"]["name"] != "AZURE"]
|
309
313
|
# Run the custom Nornir task _load_vlan_data
|
310
314
|
result = nr.run(
|
311
315
|
name=task_text,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nornir-collection
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.9
|
4
4
|
Summary: Nornir-Collection contains network automation functions and complete IaC workflows with Nornir and other python libraries. It contains Nornir tasks and general functions in Nornir style.
|
5
5
|
Author: Willi Kubny
|
6
6
|
Author-email: willi.kubny@gmail.ch
|
@@ -8,19 +8,19 @@ nornir_collection/cisco/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
8
8
|
nornir_collection/cisco/configuration_management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
nornir_collection/cisco/configuration_management/processor.py,sha256=KjhilyyDDiYL7wFemGEWSP16OLeM4dENmrtb20LRssY,6443
|
10
10
|
nornir_collection/cisco/configuration_management/pyats.py,sha256=j9XzG3ttURR0wtu2Se9QQEpG5o2kq9mqDkReNCdWKpk,8932
|
11
|
-
nornir_collection/cisco/configuration_management/utils.py,sha256=
|
11
|
+
nornir_collection/cisco/configuration_management/utils.py,sha256=0o1ZktYNIrmBpQDJ9o7f2j4sYmK__LDBb0JC4cR5iJo,18641
|
12
12
|
nornir_collection/cisco/configuration_management/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
nornir_collection/cisco/configuration_management/cli/config_tasks.py,sha256=mWXysgUm6ymNLQjomB1T05QT9A-fdV1aEKFzzDrfCUw,22147
|
14
14
|
nornir_collection/cisco/configuration_management/cli/config_workflow.py,sha256=GIka5SPLZ7M2zCFv8Jadl73QC-InnGopzI8xQt36MfM,3459
|
15
15
|
nornir_collection/cisco/configuration_management/cli/show_tasks.py,sha256=w9p2Iks33-pE4-YztH6vj-eI0MuPI7YD6gZhRcpQF7M,27971
|
16
16
|
nornir_collection/cisco/configuration_management/netconf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
nornir_collection/cisco/configuration_management/netconf/config_tasks.py,sha256=Sig1FNmjcXXWK0zIUp_-sCxZzYjnYjR_HuYguLlIlsA,22120
|
18
|
-
nornir_collection/cisco/configuration_management/netconf/config_workflow.py,sha256=
|
18
|
+
nornir_collection/cisco/configuration_management/netconf/config_workflow.py,sha256=qxB4DolQL2WJO9JRATzANhIwYPNuKyuN0hI9-ABzJq8,14557
|
19
19
|
nornir_collection/cisco/configuration_management/netconf/nr_cfg_iosxe_netconf.py,sha256=ciG2TkOC1qEtxOIKX0CjAOV3aAt3JOR7VaDvstDDy_s,8614
|
20
20
|
nornir_collection/cisco/configuration_management/netconf/ops_tasks.py,sha256=cj7cpJNvY2bytv9VOqwg_7qOekL-cIL0EjML2KT4TQM,10659
|
21
21
|
nornir_collection/cisco/configuration_management/restconf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
nornir_collection/cisco/configuration_management/restconf/cisco_rpc.py,sha256=tIccCcWegIuTRREz9wd47is4vP0bvvjH2ljB4GaOUKY,18569
|
23
|
-
nornir_collection/cisco/configuration_management/restconf/config_workflow.py,sha256=
|
23
|
+
nornir_collection/cisco/configuration_management/restconf/config_workflow.py,sha256=4UV85L8Cnb62_IJwx5w0NNB7Ohfk-LoR-D-FfEuSEJA,3509
|
24
24
|
nornir_collection/cisco/configuration_management/restconf/tasks.py,sha256=2x5ecw8PE4CZ2lf2q7NZlEQGYRjLJxYzC2udhNmqnGA,12221
|
25
25
|
nornir_collection/cisco/software_upgrade/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
nornir_collection/cisco/software_upgrade/cisco_software_upgrade.py,sha256=KX9PKTPsEVAf4DLSDCm4gP_hDUnIxlxXgG5925CYPSo,13138
|
@@ -35,7 +35,7 @@ nornir_collection/fortinet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
35
35
|
nornir_collection/fortinet/utils.py,sha256=xkvxdJy3-aD39WK_9Gc0rY9r-OxfHnPVNMspy3KZbcE,1174
|
36
36
|
nornir_collection/netbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
nornir_collection/netbox/custom_script.py,sha256=yU1lbv_25b3qAWA6GRsVYpEuh0KUPTVo47U5s_lksjo,4050
|
38
|
-
nornir_collection/netbox/inventory.py,sha256=
|
38
|
+
nornir_collection/netbox/inventory.py,sha256=2db5GogMsY5bZgc4mXIhlmH9pcvyQ7AE55dL0EiqxDI,15488
|
39
39
|
nornir_collection/netbox/scan_prefixes_and_update_ip_addresses.py,sha256=IGaE-HR_eManlENJzx7odn6yuMgpUV85NZfhpfaxpA0,41376
|
40
40
|
nornir_collection/netbox/set_device_status.py,sha256=vtn0KcR-91Z2aLjbEpZRef1Jip8eM9GWbKRiAJuEjLY,2437
|
41
41
|
nornir_collection/netbox/sync_datasource.py,sha256=eEsgwy_arIPbA-ObqqzTNdU9aiP80s7LCzAKA6hCXYQ,4703
|
@@ -52,8 +52,8 @@ nornir_collection/nornir_plugins/inventory/staggered_yaml.py,sha256=nBvUFq7U5zVT
|
|
52
52
|
nornir_collection/nornir_plugins/inventory/utils.py,sha256=mxIlKK-4PHqCnFKn7Oozu1RW_JB5z1TgEYc-ave70nE,11822
|
53
53
|
nornir_collection/purestorage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
54
54
|
nornir_collection/purestorage/utils.py,sha256=TqU2sKz0ENnmSDEBcSvXPnVkI1DVHOogI68D7l32g7I,1730
|
55
|
-
nornir_collection-0.0.
|
56
|
-
nornir_collection-0.0.
|
57
|
-
nornir_collection-0.0.
|
58
|
-
nornir_collection-0.0.
|
59
|
-
nornir_collection-0.0.
|
55
|
+
nornir_collection-0.0.9.dist-info/LICENSE,sha256=bOPVh1OVNwz2tCjkLaChWT6AoXdtqye3aua5l0tgYJo,1068
|
56
|
+
nornir_collection-0.0.9.dist-info/METADATA,sha256=3i-2daEZ2nlcCFvtLqTjzVyUL7M0Dv0gdzY1XuvpVCE,7137
|
57
|
+
nornir_collection-0.0.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
58
|
+
nornir_collection-0.0.9.dist-info/top_level.txt,sha256=OyCzPWABf-D0AOHm9ihrwdk5eq200BnKna6gIDspwsE,18
|
59
|
+
nornir_collection-0.0.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|