Skip to content
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

Bugfix: describe_event_bus()['Policy'] should be JSON string, not object #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cpitchford
Copy link
Owner

boto3.client('events')['Policy'] must be a string as per:

http://boto3.readthedocs.io/en/latest/reference/services/events.html#CloudWatchEvents.Client.describe_event_bus

Adding json.dumps() around the policy value ensures we do not return an unexpected dict

This change corrects an error when attempting to decode the policy:

json.load(boto3.client('events').describe_event_bus()['Policy'])

boto3.client('events')['Policy'] must be a string as per:
http://boto3.readthedocs.io/en/latest/reference/services/events.html#CloudWatchEvents.Client.describe_event_bus

Adding json.dumps() around the policy value ensures we do not return an unexpected dict

This change corrects an error when attempting to decode the policy:

json.load(boto3.client('events').describe_event_bus()['Policy'])
Correct the assumption that describe_event_bus()['Policy'] is a dict
As per
http://boto3.readthedocs.io/en/latest/reference/services/events.html#CloudWatchEvents.Client.describe_event_bus
It should be a JSON encoded string

Here we decode the JSON before we look inside the policy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant