catocli 3.0.29__py3-none-any.whl → 3.0.30__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.
Potentially problematic release.
This version of catocli might be problematic. Click here for more details.
- catocli/__init__.py +1 -1
- catocli/parsers/custom/export_rules/export_rules.py +13 -3
- catocli/parsers/customParserApiClient.py +3 -0
- {catocli-3.0.29.dist-info → catocli-3.0.30.dist-info}/METADATA +1 -1
- {catocli-3.0.29.dist-info → catocli-3.0.30.dist-info}/RECORD +9 -9
- {catocli-3.0.29.dist-info → catocli-3.0.30.dist-info}/WHEEL +0 -0
- {catocli-3.0.29.dist-info → catocli-3.0.30.dist-info}/entry_points.txt +0 -0
- {catocli-3.0.29.dist-info → catocli-3.0.30.dist-info}/licenses/LICENSE +0 -0
- {catocli-3.0.29.dist-info → catocli-3.0.30.dist-info}/top_level.txt +0 -0
catocli/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "3.0.
|
|
1
|
+
__version__ = "3.0.30"
|
|
2
2
|
__cato_host__ = "https://api.catonetworks.com/api/v1/graphql2"
|
|
@@ -7,7 +7,8 @@ from graphql_client.api_client import ApiException
|
|
|
7
7
|
from ..customLib import writeDataToFile, makeCall, getAccountID
|
|
8
8
|
|
|
9
9
|
def strip_ids_recursive(data):
|
|
10
|
-
"""Recursively strip id attributes from data structure, but only from objects that contain only 'id' and 'name' keys
|
|
10
|
+
"""Recursively strip id attributes from data structure, but only from objects that contain only 'id' and 'name' keys.
|
|
11
|
+
If a name contains a backslash character, keep the id and remove the name instead."""
|
|
11
12
|
try:
|
|
12
13
|
if isinstance(data, dict):
|
|
13
14
|
# Check if this dict should have its 'id' stripped
|
|
@@ -15,10 +16,19 @@ def strip_ids_recursive(data):
|
|
|
15
16
|
dict_keys = set(data.keys())
|
|
16
17
|
should_strip_id = dict_keys == {'id', 'name'} or dict_keys == {'name', 'id'}
|
|
17
18
|
|
|
19
|
+
# Check if name contains backslash
|
|
20
|
+
name_has_backslash = should_strip_id and 'name' in data and isinstance(data['name'], str) and '\\' in data['name']
|
|
21
|
+
|
|
18
22
|
result = {}
|
|
19
23
|
for k, v in data.items():
|
|
20
|
-
if
|
|
21
|
-
#
|
|
24
|
+
if name_has_backslash:
|
|
25
|
+
# If name contains backslash, keep id and skip name
|
|
26
|
+
if k == 'name':
|
|
27
|
+
continue
|
|
28
|
+
else:
|
|
29
|
+
result[k] = strip_ids_recursive(v)
|
|
30
|
+
elif k == 'id' and should_strip_id:
|
|
31
|
+
# Normal case: Skip id key if this object contains only id and name
|
|
22
32
|
continue
|
|
23
33
|
else:
|
|
24
34
|
# Keep the key and recursively process the value
|
|
@@ -262,6 +262,9 @@ def createRequest(args, configuration):
|
|
|
262
262
|
json_data
|
|
263
263
|
)
|
|
264
264
|
print(f"Sentinel API response code: {result_code}")
|
|
265
|
+
|
|
266
|
+
# Return None to prevent JSON output to stdout when streaming to network/sentinel
|
|
267
|
+
return None
|
|
265
268
|
|
|
266
269
|
# Apply formatting based on effective format
|
|
267
270
|
if effective_format == 'raw' or not default_override:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
catocli/__init__.py,sha256=
|
|
1
|
+
catocli/__init__.py,sha256=wZb6C8x4eOgfiTUiFHp23xLF_AVgK71s3B0duNTPCDU,85
|
|
2
2
|
catocli/__main__.py,sha256=6Z0ns_k_kUcz1Qtrn1u7UyUnqB-3e85jM_nppOwFsv4,217
|
|
3
3
|
catocli/clisettings.json,sha256=Mkzs0o969-l1-bbp5SgHecJsQp3I-IP3w5EpnP6nMgg,2062
|
|
4
4
|
catocli/Utils/clidriver.py,sha256=1-T62xar7n7Pfzz0GIcuvUZoCZ5_WF3G5GfI5UfreBM,16750
|
|
@@ -14,7 +14,7 @@ catocli/Utils/graphql_utils.py,sha256=yUSJ1gE2_LRYTHq46w6vOa84IuU6BXlBMr1gQB2RcG
|
|
|
14
14
|
catocli/Utils/help_formatter.py,sha256=ZybosiFK0ikOI0hdb0p3yy5GMJG5agqn_p6xxb_Dd-4,37406
|
|
15
15
|
catocli/Utils/profile_manager.py,sha256=a-cIhlhOiFbAEuX5Im0JraalWufkcAZS1NQQ0T4ck8I,7763
|
|
16
16
|
catocli/Utils/version_checker.py,sha256=tCtsCn7xxMIxOm6cWJSA_yPt0j4mNMK4iWSJej0yM6A,6696
|
|
17
|
-
catocli/parsers/customParserApiClient.py,sha256=
|
|
17
|
+
catocli/parsers/customParserApiClient.py,sha256=QFxQdXhCQLFsEZUhcFXI_3SpAcXcd1Tog6XHs8zvTZE,92670
|
|
18
18
|
catocli/parsers/configure/__init__.py,sha256=Nd71cY3yLPhz9yhiNCi44iNpsfziRVk1egqHq30LBV4,3554
|
|
19
19
|
catocli/parsers/configure/configure.py,sha256=0TIHA_RU-odWkTAtbD6PzHo6ssAoq1fZT-AE7jdnGYU,14283
|
|
20
20
|
catocli/parsers/custom/README.md,sha256=ehw97vJx_Cnlyb-a8ItdREDDVGrGdu8k5ZJ9hT6F4Ew,9577
|
|
@@ -22,7 +22,7 @@ catocli/parsers/custom/__init__.py,sha256=bzYo9pBrRLharA8kXZA2P3M1N-0_-kXwcbtRwv
|
|
|
22
22
|
catocli/parsers/custom/customLib.py,sha256=W4L-4FK9qDJC43V390sk9L-ld55ZySKsMe9MpoHP7WY,24272
|
|
23
23
|
catocli/parsers/custom/eventsFeedEnhanced.py,sha256=aOqikBI76QxMKoMdW7M37mEf-W2ODipusGitpt-cF7k,16330
|
|
24
24
|
catocli/parsers/custom/export_rules/__init__.py,sha256=sQYfhsAJgXHa_pUQ6XCL92DUYGFubfgBf_3UMeiX1BM,3629
|
|
25
|
-
catocli/parsers/custom/export_rules/export_rules.py,sha256
|
|
25
|
+
catocli/parsers/custom/export_rules/export_rules.py,sha256=-Z5Mr1ZlkkJAufGNb-TAm-ncYOP0XPGTJ2QIbGanrTA,16189
|
|
26
26
|
catocli/parsers/custom/export_sites/__init__.py,sha256=uq7-85kRpaYSeapGgkwNtpWeB2h6T_krQA1q3i0xGcY,3601
|
|
27
27
|
catocli/parsers/custom/export_sites/export_sites.py,sha256=CTGe-xXvs6cLThiyuQUyFKz2bLUkwscM2eMytKFg-Bo,82160
|
|
28
28
|
catocli/parsers/custom/import_rules_to_tf/__init__.py,sha256=StXUnw2N7YebYXVEmPyXNQX1EBP7T8FZYCxOO67I6LU,4812
|
|
@@ -420,7 +420,7 @@ catocli/templates/scim_users.csv,sha256=Fb_C9W2cXf1swnKSNXanWabny87TKcbwxpor5ze3
|
|
|
420
420
|
catocli/templates/scim_users.json,sha256=VRBc2rDRMiIcA6navhnqdnuvLmouKd9ZE7ZrzGb7kfI,582
|
|
421
421
|
catocli/templates/socket_sites.csv,sha256=S5qY7whbydinMwomoAlDghoiFO_xqUKRwNG1xvzl8BI,1212
|
|
422
422
|
catocli/templates/socket_sites.json,sha256=X3NShci5-q3TpVSsaj62u4jFCvQAhxQ7knC-Lui_gOg,19535
|
|
423
|
-
catocli-3.0.
|
|
423
|
+
catocli-3.0.30.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
424
424
|
graphql_client/__init__.py,sha256=2nxD4YsWoOnALXi5cXbmtIN_i0NL_eyDTQRTxs52mkI,315
|
|
425
425
|
graphql_client/api_client.py,sha256=2Rc1Zo1xH9Jnk1AO68kLSofTShkZwSVF-WkVtczfIc4,5786
|
|
426
426
|
graphql_client/api_client_types.py,sha256=y1oy1qsg8TM_FPxb8m53ED7tBU29WDhtQqzgg247_kI,11754
|
|
@@ -771,8 +771,8 @@ vendor/urllib3/util/timeout.py,sha256=4eT1FVeZZU7h7mYD1Jq2OXNe4fxekdNvhoWUkZusRp
|
|
|
771
771
|
vendor/urllib3/util/url.py,sha256=wHORhp80RAXyTlAIkTqLFzSrkU7J34ZDxX-tN65MBZk,15213
|
|
772
772
|
vendor/urllib3/util/util.py,sha256=j3lbZK1jPyiwD34T8IgJzdWEZVT-4E-0vYIJi9UjeNA,1146
|
|
773
773
|
vendor/urllib3/util/wait.py,sha256=_ph8IrUR3sqPqi0OopQgJUlH4wzkGeM5CiyA7XGGtmI,4423
|
|
774
|
-
catocli-3.0.
|
|
775
|
-
catocli-3.0.
|
|
776
|
-
catocli-3.0.
|
|
777
|
-
catocli-3.0.
|
|
778
|
-
catocli-3.0.
|
|
774
|
+
catocli-3.0.30.dist-info/METADATA,sha256=IAaUcJZ4dHm5gXsM67QZK4K63a9CpyWzSN16FTTcMAc,6816
|
|
775
|
+
catocli-3.0.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
776
|
+
catocli-3.0.30.dist-info/entry_points.txt,sha256=p4k9Orre6aWcqVrNmBbckmCs39h-1naMxRo2AjWmWZ4,50
|
|
777
|
+
catocli-3.0.30.dist-info/top_level.txt,sha256=cRT_qNMM5G7w-dpT1BnJB9eikqydO0jafLlS4OD-7MI,44
|
|
778
|
+
catocli-3.0.30.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|