-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fixes for Issue 57 #61
base: main
Are you sure you want to change the base?
Conversation
@@ -140,7 +140,7 @@ def consolidate_service_like_objects(profilepackage, object_type, object_friendl | |||
replacements_made[member_to_replace] = service_to_replacement[member_to_replace] | |||
object_policy_dict['service'] = service_to_replacement[member_to_replace] | |||
# If it's a policy with only one member, it'll be parsed as a string, not a list | |||
elif isinstance(object_policy_dict['service']['member'], str): | |||
elif isinstance(object_policy_dict['service']['member'], str) and object_policy_dict['service']['member'] in service_to_replacement: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: and object_policy_dict['service']['member'] in service_to_replacement
I'm concerned for a scenario where there is only a single member, so the value is a string, but not present in the service_to_replacement
mapping, and so it wouldn't pass the second condition. What would then happen is that it would then execute the else
statement, which would iterate through the value as a string
(meaning, iterating through one character at a time).
As such, this seems like this change would introduce a bug. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not aware of functionality end-to-end, I got issue in a case where object_policy_dict['service']['member']
was not present in service_to_replacement
and the code was breaking on line 146
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created a new release with additional debugging. Could you re-run pan_analyzer with --debug appended and paste the object's information from the bottom of the debug file, after the crash that this is intended to fix, so I can see the problematic object?
Bug Fix for Issue - #57
Fixes :