PyPANRestV2 2.1.9__tar.gz → 2.1.10__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.
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/PKG-INFO +1 -1
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/Panorama.py +9 -1
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pyproject.toml +1 -1
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/README.md +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/ApplicationHelper.py +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/Base.py +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/Device.py +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/Exceptions.py +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/Network.py +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/Objects.py +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/Policies.py +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/XDR.py +0 -0
- {pypanrestv2-2.1.9 → pypanrestv2-2.1.10}/pypanrestv2/__init__.py +0 -0
|
@@ -314,13 +314,21 @@ class TemplateStacks(PanoramaTab):
|
|
|
314
314
|
self._ensure_device_variables_container(device_entry)
|
|
315
315
|
|
|
316
316
|
variable_found = False
|
|
317
|
-
|
|
317
|
+
# Use get() accessors to avoid KeyError if the container wasn't
|
|
318
|
+
# fully normalized for some reason.
|
|
319
|
+
for var_entry in device_entry.get('variable', {}).get('entry', []):
|
|
318
320
|
if var_entry.get('@name') == variable_name:
|
|
319
321
|
var_entry['type'] = {variable_type: variable_value}
|
|
320
322
|
variable_found = True
|
|
321
323
|
break
|
|
322
324
|
|
|
323
325
|
if not variable_found:
|
|
326
|
+
# Ensure the entry list exists before appending
|
|
327
|
+
if 'variable' not in device_entry or not isinstance(device_entry['variable'], dict):
|
|
328
|
+
device_entry['variable'] = {'entry': []}
|
|
329
|
+
if 'entry' not in device_entry['variable'] or not isinstance(device_entry['variable']['entry'], list):
|
|
330
|
+
device_entry['variable']['entry'] = []
|
|
331
|
+
|
|
324
332
|
device_entry['variable']['entry'].append({
|
|
325
333
|
'@name': variable_name,
|
|
326
334
|
'type': {variable_type: variable_value}
|
|
@@ -3,7 +3,7 @@ requires = ["poetry-core>=1.0.0"]
|
|
|
3
3
|
build-backend = "poetry.core.masonry.api"
|
|
4
4
|
[tool.poetry]
|
|
5
5
|
name = "PyPANRestV2"
|
|
6
|
-
version = "2.1.
|
|
6
|
+
version = "2.1.10"
|
|
7
7
|
description = "Python tools for interacting with Palo Alto Networks REST API."
|
|
8
8
|
authors = [
|
|
9
9
|
"Mark Rzepa <mark@rzepa.com>"
|
|
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
|