Skip to content

Commit

Permalink
Merge branch 'main' into support/3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dsuch committed Oct 15, 2024
2 parents f9e2aee + 6e241c3 commit 0b7feda
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions code/zato-cli/src/zato/cli/enmasse.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class ModuleCtx:

class Include_Type:
All = 'all'
Cache = 'cache'
LDAP = 'ldap'
SQL = 'sql'
PubSub = 'pubsub'
Expand Down Expand Up @@ -201,6 +202,7 @@ class Include_Type:
# REST connections
'channel_plain_http': ModuleCtx.Include_Type.REST,
'outconn_plain_http': ModuleCtx.Include_Type.REST,
'zato_cache_builtin': ModuleCtx.Include_Type.Cache,
'zato_generic_rest_wrapper': ModuleCtx.Include_Type.REST,
'zato_generic_connection': ModuleCtx.Include_Type.LDAP,

Expand Down Expand Up @@ -325,6 +327,13 @@ class Include_Type:

ModuleCtx.Enmasse_Attr_List_Exclude = {

# Cache definitions
'zato_cache_builtin': [
'cache_id',
'current_size',
'opaque1',
],

# REST connections - Channels
'channel_plain_http': [
'connection',
Expand Down Expand Up @@ -1317,7 +1326,7 @@ def scan_item(self, item_type:'str', item:'Bunch', results:'Results') -> 'None':
continue

# Special-case HTTP connections
if item_type == 'http_soap': # type: ignore
if item_type in ('http_soap', 'web_socket'): # type: ignore
dep_key = resolve_security_field_name(item)

if dep_key not in item:
Expand Down Expand Up @@ -3410,19 +3419,21 @@ def _preprocess_item_attrs_during_export(
# .. to make sure the dictionary does not change during iteration ..
item_copy = deepcopy(item)

# .. we enter here if there is anything to be explicitly process ..
# .. we enter here if there is anything to be explicitly processed ..
if attr_list_include or attr_list_exclude:

# .. go through everything that we have ..
for attr in item_copy:

# .. remove from the item that we are returning any attr that is not to be included
if attr not in attr_list_include:
_ = item.pop(attr, None)
if attr_list_include:
if attr not in attr_list_include:
_ = item.pop(attr, None)

# .. remove any attribute that is explictly configured to be excluded ..
if attr in attr_list_exclude:
_ = item.pop(attr, None)
if attr_list_exclude:
if attr in attr_list_exclude:
_ = item.pop(attr, None)

# .. optionally, rename selected attributes ..
for old_name, new_name in attr_list_rename.items():
Expand Down Expand Up @@ -3510,7 +3521,7 @@ def _preprocess_item_attrs_during_export(
# .. service ID's are never returned ..
_ = item.pop('service_id', None)

# .. the is_active flag is never returned if it is of it default value, which is True ..
# .. the is_active flag is never returned if it has its default value, which is True ..
if item.get('is_active') is True:
_ = item.pop('is_active', None)

Expand Down Expand Up @@ -3872,8 +3883,8 @@ def report_warnings_errors(self, items): # type: ignore
warn_err, warn_no, error_no = self.get_warnings_errors(items)
table = self.get_table(warn_err)

warn_plural = '' if warn_no == 1 else 's'
error_plural = '' if error_no == 1 else 's'
warn_plural = '' if warn_no == 1 else 's' # type: ignore
error_plural = '' if error_no == 1 else 's' # type: ignore

if warn_no or error_no:
if error_no:
Expand Down

0 comments on commit 0b7feda

Please sign in to comment.