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

Initialise Container cdn data to defaults if no cdn_connection. #254

Closed
wants to merge 1 commit into from

Conversation

absoludity
Copy link

AFAICT, currently the Container.cdn_enabled property errors when your client doesn't have a cdn connection (ie. using non-rackspace openstack).

This branch ensures that when a Container object is initialised with a client, it sets the default cdn details if the client doesn't have a cdn connection, otherwise the previous behaviour of setting the values to be loaded lazily.

Notes

I initially thought the Client.cdn_enabled class property was relevant, but then found it's never actually referenced anywhere, and the tests pass without it. So either there's code out there depending on a class property that always returns False, or it's not used at all. I'm assuming it should be removed, but didn't make that call given that it's a public property.

I added some whitespace to the 2 relevant tests only because it wasn't obvious (to me) where the test-setup, code execution and expectations started/ended. If that's not OK, happy to remove it.

@coveralls
Copy link

Coverage Status

Coverage increased (+3.43%) when pulling f35aa02 on absoludity:working into 9ae649f on rackspace:working.

EdLeafe added a commit that referenced this pull request Jun 4, 2014
Previously if using an OpenStack deployment that did not have CDN,
referencing one of the cdn properties of the container would cause pyrax
to try to query the (non-existent) CDN endpoint.
EdLeafe added a commit that referenced this pull request Jun 4, 2014
Previously if using an OpenStack deployment that did not have CDN,
referencing one of the cdn properties of the container would cause pyrax
to try to query the (non-existent) CDN endpoint.
@EdLeafe
Copy link
Contributor

EdLeafe commented Jun 4, 2014

Adding a return after the initial call to self._set_cdn_defaults() was all that was needed to fix this. Thanks for catching the problem!

@EdLeafe EdLeafe closed this Jun 4, 2014
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.

3 participants