videoipath-automation-tool 0.2.2.dev176__tar.gz → 0.2.3.dev178__tar.gz
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.
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/PKG-INFO +1 -1
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/pyproject.toml +1 -1
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/app/app.py +7 -4
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/inventory_api.py +35 -39
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/LICENSE +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/README.md +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/app/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/app/create_device.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/app/create_device_from_discovered_device.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/app/get_device.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/inventory_utils.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/device_status.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/driver_schema/2023.4.2.json +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/driver_schema/2023.4.35.json +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/driver_schema/2024.1.4.json +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/driver_schema/2024.3.3.json +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/driver_schema/README.md +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/drivers.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/inventory_device.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/inventory_device_configuration.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/inventory_device_configuration_compare.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/inventory_discovered_device.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/inventory/model/inventory_request_rpc.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/model/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/model/allocator_pools_models.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/model/interface_item.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/model/license_models.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/model/package_item.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/preferences_api.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/preferences_app.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/sections/apps.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/sections/license.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/sections/packages_and_certificates.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/preferences/sections/system_configuration.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/profile/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/profile/model/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/profile/model/profile_model.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/profile/model/schema_custom.json +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/profile/profile_api.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/profile/profile_app.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/helper/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/helper/placement.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/actions/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/actions/validate_topology_update.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/n_graph_schema/2023.4.2_nGraphSchemaFlat.json +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/n_graph_schema/2023.4.2_nGraphSchemaRef.json +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/n_graph_schema/2024.1.4_nGraphSchemaFlat.json +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/n_graph_schema/README.md +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/topology_base_device.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/topology_codec_vertex.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/topology_generic_vertex.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/topology_ip_vertex.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/topology_n_graph_element.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/topology_unidirectional_edge.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/n_graph_elements/topology_vertex.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/topology_device.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/topology_device_configuration.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/model/topology_device_configuration_compare.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/topology_api.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/topology/topology_app.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/apps/videoipath_app.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/models/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/models/request_rest_v2.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/models/request_rpc.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/models/response_rest_v2.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/models/response_rpc.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/vip_base_connector.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/vip_connector.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/vip_rest_connector.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/connector/vip_rpc_connector.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/settings.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/utils/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/utils/cross_app_utils.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/utils/custom_warnings.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/validators/__init__.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/validators/alarm_filter.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/validators/device_id.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/validators/device_id_including_virtual.py +0 -0
- {videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/src/videoipath_automation_tool/validators/virtual_device_id.py +0 -0
{videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: videoipath-automation-tool
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3.dev178
|
|
4
4
|
Summary: A Python package for automating VideoIPath configuration workflows.
|
|
5
5
|
License: AGPL-3.0-only
|
|
6
6
|
Keywords: videoipath,automation,nevion,media-over-ip,st2110,orchestration
|
|
@@ -88,12 +88,14 @@ class InventoryApp(InventoryCreateDeviceMixin, InventoryCreateDeviceFromDiscover
|
|
|
88
88
|
)
|
|
89
89
|
|
|
90
90
|
online_device = self._inventory_api.add_device(device, config_only=config_only)
|
|
91
|
-
self._logger.info(
|
|
91
|
+
self._logger.info(
|
|
92
|
+
f"Device '{online_device.label}' added successfully to Inventory with id '{online_device.device_id}'."
|
|
93
|
+
)
|
|
92
94
|
|
|
93
95
|
return online_device
|
|
94
96
|
|
|
95
97
|
def update_device(
|
|
96
|
-
self, device: InventoryDevice[CustomSettingsType], compare_config: bool = True
|
|
98
|
+
self, device: InventoryDevice[CustomSettingsType], compare_config: bool = True, config_only: bool = False
|
|
97
99
|
) -> InventoryDevice[CustomSettingsType]:
|
|
98
100
|
"""
|
|
99
101
|
Method to update a devices configuration in VideoIPath-Inventory.
|
|
@@ -102,6 +104,7 @@ class InventoryApp(InventoryCreateDeviceMixin, InventoryCreateDeviceFromDiscover
|
|
|
102
104
|
Args:
|
|
103
105
|
device (InventoryDevice): Device to update in Inventory.
|
|
104
106
|
compare_config (bool, optional): Compare the configuration of the device with the existing device configuration in Inventory, to prevent unnecessary updates. Defaults to True.
|
|
107
|
+
config_only (bool, optional): Update device with configuration only. Defaults to False.
|
|
105
108
|
|
|
106
109
|
Raises:
|
|
107
110
|
ValueError: If no device_id is given in device configuration (in InventoryDevice instance).
|
|
@@ -130,7 +133,7 @@ class InventoryApp(InventoryCreateDeviceMixin, InventoryCreateDeviceFromDiscover
|
|
|
130
133
|
if filtered_diffs.added or filtered_diffs.changed or filtered_diffs.removed:
|
|
131
134
|
debug_message = self._hide_passwords_in_diffs(filtered_diffs.model_dump(mode="json"))
|
|
132
135
|
self._logger.info(
|
|
133
|
-
f"Device configuration changed. Updating device in Inventory.
|
|
136
|
+
f"Device configuration changed. Updating device in Inventory. Changes: {debug_message}"
|
|
134
137
|
)
|
|
135
138
|
else:
|
|
136
139
|
self._logger.info("Device configuration did not change. No update necessary.")
|
|
@@ -138,7 +141,7 @@ class InventoryApp(InventoryCreateDeviceMixin, InventoryCreateDeviceFromDiscover
|
|
|
138
141
|
else:
|
|
139
142
|
self._logger.info("Updating device in Inventory without comparing configuration.")
|
|
140
143
|
|
|
141
|
-
online_device = self._inventory_api.update_device(device)
|
|
144
|
+
online_device = self._inventory_api.update_device(device, config_only=config_only)
|
|
142
145
|
self._logger.info(f"Device '{online_device.label}' updated in Inventory with id '{online_device.device_id}'.")
|
|
143
146
|
return online_device
|
|
144
147
|
|
|
@@ -58,7 +58,13 @@ class InventoryAPI:
|
|
|
58
58
|
if not device_id.startswith("device"):
|
|
59
59
|
raise ValueError("device_id must start with 'device'.")
|
|
60
60
|
self._logger.debug(f"Retrieving device '{device_id}' from VideoIPath-Inventory.")
|
|
61
|
+
if custom_settings_type:
|
|
62
|
+
self._logger.debug(
|
|
63
|
+
f"Using custom settings type '{custom_settings_type.__name__}' for device '{device_id}'."
|
|
64
|
+
)
|
|
65
|
+
|
|
61
66
|
online_device = self._fetch_device_config(device_id)
|
|
67
|
+
|
|
62
68
|
if not config_only:
|
|
63
69
|
if not isinstance(status_fetch_retry, int):
|
|
64
70
|
self._logger.warning("status_fetch_retry must be an integer. Using default value of 20.")
|
|
@@ -80,7 +86,7 @@ class InventoryAPI:
|
|
|
80
86
|
break
|
|
81
87
|
except ValueError:
|
|
82
88
|
self._logger.debug(
|
|
83
|
-
f"Failed to get device status for device '{online_device.configuration.id}', retrying ({21-retry_cnt}/{status_fetch_retry}) ..."
|
|
89
|
+
f"Failed to get device status for device '{online_device.configuration.id}', retrying ({21 - retry_cnt}/{status_fetch_retry}) ..."
|
|
84
90
|
)
|
|
85
91
|
time.sleep(status_fetch_delay)
|
|
86
92
|
retry_cnt -= 1
|
|
@@ -90,6 +96,7 @@ class InventoryAPI:
|
|
|
90
96
|
)
|
|
91
97
|
else:
|
|
92
98
|
self._logger.debug(f"Skipping status update for device '{device_id}'.")
|
|
99
|
+
|
|
93
100
|
self._logger.debug(f"Device '{device_id}' retrieved from VideoIPath-Inventory.")
|
|
94
101
|
return online_device
|
|
95
102
|
|
|
@@ -120,11 +127,11 @@ class InventoryAPI:
|
|
|
120
127
|
if device.configuration.id != "":
|
|
121
128
|
raise ValueError(
|
|
122
129
|
"Device ID must be empty when adding a new device! "
|
|
123
|
-
"Set 'id' to an empty string 'InventoryDevice.remove_device_id()' or use 'inventory_api.update_device()'
|
|
130
|
+
"Set 'id' to an empty string 'InventoryDevice.remove_device_id()' or use 'inventory_api.update_device()' if an existing device should be updated."
|
|
124
131
|
)
|
|
125
132
|
|
|
126
133
|
self._logger.debug(
|
|
127
|
-
f"Adding new device with label '{device.configuration.config.desc.label}' to VideoIPath-Inventory."
|
|
134
|
+
f"Adding new device with label '{device.configuration.config.desc.label}' and address '{device.configuration.config.cinfo.address}' to VideoIPath-Inventory."
|
|
128
135
|
)
|
|
129
136
|
|
|
130
137
|
tracking_id = str(uuid4())
|
|
@@ -158,50 +165,39 @@ class InventoryAPI:
|
|
|
158
165
|
|
|
159
166
|
online_device = self._fetch_device_config_by_uuid(uuid=tracking_id)
|
|
160
167
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
status_fetch_retry = 20
|
|
165
|
-
if not isinstance(status_fetch_delay, int):
|
|
166
|
-
self._logger.warning("status_check_delay must be an integer. Using default value of 2.")
|
|
167
|
-
status_fetch_delay = 2
|
|
168
|
-
if status_fetch_retry < 1:
|
|
169
|
-
self._logger.warning("status_fetch_retry must be greater than 0. Using default value of 20.")
|
|
170
|
-
status_fetch_retry = 20
|
|
171
|
-
if status_fetch_delay < 1:
|
|
172
|
-
self._logger.warning("status_check_delay must be greater than 0. Using default value of 2.")
|
|
173
|
-
status_fetch_delay = 2
|
|
174
|
-
retry_cnt = status_fetch_retry
|
|
175
|
-
while retry_cnt > 0:
|
|
176
|
-
try:
|
|
177
|
-
online_device.status = self._fetch_device_status(online_device.configuration.id)
|
|
178
|
-
if online_device.status:
|
|
179
|
-
break
|
|
180
|
-
except ValueError:
|
|
181
|
-
self._logger.debug(
|
|
182
|
-
f"Failed to get device status for device '{online_device.configuration.id}', retrying ({21-retry_cnt}/{status_fetch_retry}) ..."
|
|
183
|
-
)
|
|
184
|
-
time.sleep(status_fetch_delay)
|
|
185
|
-
retry_cnt -= 1
|
|
186
|
-
if retry_cnt == 0 and not online_device.status:
|
|
187
|
-
self._logger.warning(
|
|
188
|
-
f"Failed to get device status for device '{online_device.configuration.id}'. Retry limit reached. Returning device without status."
|
|
189
|
-
)
|
|
190
|
-
self._logger.debug(f"Device added successfully with id: {online_device.configuration.id}")
|
|
168
|
+
self._logger.debug(
|
|
169
|
+
f"Device with id '{online_device.configuration.id}' added successfully to VideoIPath-Inventory."
|
|
170
|
+
)
|
|
191
171
|
|
|
192
|
-
if clear_uuid_after_add:
|
|
172
|
+
if not clear_uuid_after_add:
|
|
173
|
+
self._logger.debug("Skip removing tracking ID ('uuid' meta field) from device configuration.")
|
|
174
|
+
else:
|
|
193
175
|
modified_device = online_device.model_copy(deep=True)
|
|
194
176
|
modified_device.configuration.meta.pop("uuid")
|
|
195
177
|
self._logger.debug(
|
|
196
178
|
"Remove tracking ID ('uuid' meta field) from device configuration and update device in VideoIPath-Inventory."
|
|
197
179
|
)
|
|
180
|
+
online_device = self.update_device(
|
|
181
|
+
device=modified_device, config_only=True
|
|
182
|
+
) # Use config_only=True to avoid status fetch and speed up the process
|
|
183
|
+
self._logger.debug("Tracking ID removed successfully from device configuration.")
|
|
184
|
+
|
|
185
|
+
if config_only:
|
|
186
|
+
self._logger.debug("Skip fetching device status after adding.")
|
|
187
|
+
else:
|
|
188
|
+
self._logger.warning(
|
|
189
|
+
"Fetching device status is enabled and may take up to 30 seconds for devices, which are not accessible for VideoIPath-Server (e.g. offline devices). "
|
|
190
|
+
"To speed up the process for those devices, `add_device(..., config_only=True)` can be used and the status retrieval can be omitted."
|
|
191
|
+
)
|
|
192
|
+
online_device = self.get_device(
|
|
193
|
+
device_id=online_device.configuration.id,
|
|
194
|
+
config_only=config_only,
|
|
195
|
+
status_fetch_delay=status_fetch_delay,
|
|
196
|
+
status_fetch_retry=status_fetch_retry,
|
|
197
|
+
)
|
|
198
198
|
|
|
199
|
-
self.
|
|
200
|
-
if response.header.status != "OK":
|
|
201
|
-
raise ValueError(f"Failed to update device in VideoIPath-Inventory. Error: {response}")
|
|
199
|
+
self._logger.debug(f"Device added successfully with id: {online_device.configuration.id}")
|
|
202
200
|
|
|
203
|
-
online_device = modified_device
|
|
204
|
-
self._logger.debug("Tracking ID removed successfully from device configuration.")
|
|
205
201
|
return online_device
|
|
206
202
|
|
|
207
203
|
def update_device(
|
|
File without changes
|
{videoipath_automation_tool-0.2.2.dev176 → videoipath_automation_tool-0.2.3.dev178}/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|