Initialise Container cdn data to defaults if no cdn_connection. #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.