Skip to content

Commit

Permalink
fix: fixed proxy validator
Browse files Browse the repository at this point in the history
  • Loading branch information
anaik91 committed Feb 3, 2025
1 parent fdbbcc2 commit 901e45d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions core_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@ def validate_artifacts(cfg, resources_list, export_data): # noqa pylint: disabl
apps = export_data['orgConfig']['apps']
report['apps'] = apigee_validator.validate_org_resource('apps', apps)
if 'all' in resources_list or 'apis' in resources_list:
validation = apigee_validator.validate_proxy_bundles(export_dir, 'apis')
apis_validation = apigee_validator.validate_proxy_bundles(export_dir, 'apis')
# Todo # pylint: disable=W0511
# validate proxy unifier output bundles
report.update(validation)
report.update(apis_validation)
if 'all' in resources_list or 'sharedflows' in resources_list:
validation = apigee_validator.validate_proxy_bundles(export_dir, 'sharedflows')
sf_validation = apigee_validator.validate_proxy_bundles(export_dir, 'sharedflows')
# Todo # pylint: disable=W0511
# validate proxy unifier output bundles
report.update(validation)
report.update(sf_validation)
return report


Expand Down
5 changes: 2 additions & 3 deletions validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,12 @@ def validate_proxy_bundles(self, export_dir, api_type):
sharedflows.
"""
objects = self.target_export_data.get('orgConfig', {}).get(api_type, {}).keys() # noqa pylint: disable=C0301
objects_list = {api_type: objects}
validation = {'apis': [], 'sharedflows': []}
validation = {api_type: []}
bundle_dir = f"{export_dir}/{api_type}"
for proxy_bundle in list_dir(bundle_dir):
each_validation = self.validate_proxy(bundle_dir, api_type, proxy_bundle) # noqa pylint: disable=C0301
api_name = proxy_bundle.split(".zip")[0]
if api_name in objects_list[api_type]:
if api_name in objects:
each_validation['imported'] = True
else:
each_validation['imported'] = False
Expand Down

0 comments on commit 901e45d

Please sign in to comment.