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

Fix metadata service for OpenStack #526

Merged
merged 1 commit into from Jan 11, 2021
Merged

Fix metadata service for OpenStack #526

merged 1 commit into from Jan 11, 2021

Conversation

ekeih
Copy link
Contributor

@ekeih ekeih commented Dec 19, 2020

requests.get().json() returns a dict and not an object.

fixes #525

@baylisscg you contributed the change a few months ago in https://github.com/zalando/spilo/pull/486/files. Maybe you could have a look at this change and the issue #525 and provide some feedback if you agree with it or if you see an issue?

requests.get().json() returns a dict and not an object.

fixes #525
@ekeih
Copy link
Contributor Author

ekeih commented Dec 19, 2020

The tests failed, but looking at the error /bin/sh: 1: cd: can't cd to /usr/share/postgresql/12/contrib/postgis-3.0 I doubt that this is caused by my change. Please let me know if you think it is.

@@ -389,7 +389,7 @@ def get_instance_metadata(provider):
mapping = {} # Disable multi-url fetch
url = 'http://169.254.169.254/openstack/latest/meta_data.json'
openstack_metadata = requests.get(url, timeout=5).json()
metadata['zone'] = openstack_metadata.availability_zone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no dealing at this point with errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the old implementation just crashed. If the current MR has an issue the same would happen.

@Jan-M
Copy link
Member

Jan-M commented Jan 7, 2021

👍

1 similar comment
@CyberDem0n
Copy link
Contributor

👍

@CyberDem0n CyberDem0n merged commit 5138179 into zalando:master Jan 11, 2021
@CyberDem0n
Copy link
Contributor

Merged.
Thank you, @ekeih!

dratzke pushed a commit to Patagona/spilo that referenced this pull request May 25, 2021
dratzke pushed a commit to Patagona/spilo that referenced this pull request Jul 26, 2021
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.

'dict' object has no attribute 'availability_zone' with spilo 2.0-p2 on OpenStack
3 participants