-
Notifications
You must be signed in to change notification settings - Fork 925
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
Set metadata - OpenStack driver #33
Conversation
|
||
def test_ex_set_metadata(self): | ||
try: | ||
self.driver.ex_set_metadata(self.node, {'a-key': 'a-value'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't really test much. Ideally you would also mock the response and they verify the metadata
attribute on the returned Node object.
…sing metadata endpoint explicitly
""" | ||
Get a Node's metadata. | ||
|
||
@return Key/Value metadata to associate with a node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we document return types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@return C{dict} : Key/Value metadata to associate with a node
should work.
public_ip=None, private_ip=None, driver=self.driver, | ||
) | ||
metadata = {'doo': 'wop'} | ||
new_node = self.driver.ex_set_metadata(old_node, metadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ex_set_metadata returns the metadata dictionary not the Node object.
I've committed your patch with a bunch of fixes and a test for |
Thanks, Kami. I made most of these changes last night, but for some reason I only pushed the fixtures. Sucks, too, because I was proud I'd figured it out and written good tests =P |
also, this is handy for verifying that it works: https://gist.github.com/6a3f611a80b84b3b1b77 |
No problem. And yeah I know it takes some time to figure out how the whole tests fixture stuff works :) My goal before 1.0 release is to have at least some basics docs up which explain how our tests work and how to use the fixtures. |
Can you please close this pull request (I can't do it)? Thanks. |
…d..d499194be d499194be README: prep 1.0.8 cf52d21d8 Remove pin on requests (fixes #41) (#42) 3ac8fed01 README: prep 1.0.7 (#40) f7e969538 requirements: constrain requests below 2.30 (#39) 28aa5e1be New issue templates (#37) 1abec09c8 action: replace `internal-be-careful-debug` (#36) 75edeacda README: prep 1.0.6 (#34) 666b1b883 Check that output file exists before opening (#33) git-subtree-dir: .github/actions/gh-action-pip-audit git-subtree-split: d499194be74aeb3bc7dbed3a224a87e1831132c7
From http://docs.openstack.org/cactus/openstack-compute/developer/openstack-compute-api-1.1/content/ServerUpdate.html:
This operation updates the editable attributes of a server: the name of the server, the server metadata, and the IPv4 and IPv6 access address. Note that while the server name is editable, the operation does not change the server host name. Note also that server names are not guaranteed to be unique.