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

[FLOC-3767] Container volume support in API client #2388

Merged
merged 6 commits into from
Dec 31, 2015

Conversation

jongiddy
Copy link
Contributor

For benchmarking, we still require the container API. However, the flocker.apiclient.Client does not support volumes attached to containers, which is needed for benchmarking.

This PR adds support for stateful containers to the API client, both when creating containers, and when receiving information about container configuration and state.

Note the use of PEP 484 type annotations in the docstrings. Currently we have a variety of patterns for non-primitive docstring types (including |, top-level type only (dict), verbose descriptions, and leaving them out completely). Despite there being no implementation support for them in Python 2, the PEP 484 type annotations work particularly well for a function like _parse_volumes, where they quickly make apparent the transformation taking place.

@@ -760,15 +801,23 @@ def _parse_configuration_container(self, container_dict):
:return: ``Container`` instance.
"""
return Container(
node_uuid=UUID(hex=container_dict[u"node_uuid"], version=4),
node_uuid=UUID(hex=container_dict[u"node_uuid"]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is not really related to this PR. But setting the version of a UUID only makes sense if we are minting a new UUID from some data. Overriding the version when creating a UUID instance from existing UUID data is asking for trouble.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks.

@jml
Copy link
Contributor

jml commented Dec 28, 2015

I'm happy w/ the PEP 484 things in docstrings.

Thanks!

Jonathan Giddy added 2 commits December 31, 2015 12:09
This is not actually required, since removing a PClass attribute will
return it to the initial value. It is not possible to really remove a
PClass attribute with an initial value.

However, following submission of a bug report, there may be changes in
the future.  Pyrsistent is pre-1.0.
jongiddy added a commit that referenced this pull request Dec 31, 2015
…LOC-3767

[FLOC-3767] Container volume support in API client
@jongiddy jongiddy merged commit 43114d4 into master Dec 31, 2015
@jongiddy jongiddy deleted the apiclient-container-volumes-FLOC-3767 branch December 31, 2015 14:04
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.

2 participants