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

Set metadata - OpenStack driver #33

Closed
wants to merge 6 commits into from

Conversation

mynnx
Copy link

@mynnx mynnx commented Oct 28, 2011

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.


def test_ex_set_metadata(self):
try:
self.driver.ex_set_metadata(self.node, {'a-key': 'a-value'})
Copy link
Member

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.

"""
Get a Node's metadata.

@return Key/Value metadata to associate with a node
Copy link
Author

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?

Copy link
Member

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)
Copy link
Member

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.

@Kami
Copy link
Member

Kami commented Nov 2, 2011

I've committed your patch with a bunch of fixes and a test for ex_get_metadata in r1196577 (http://svn.apache.org/viewvc?view=revision&revision=1196577).

@mynnx
Copy link
Author

mynnx commented Nov 2, 2011

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

@mynnx
Copy link
Author

mynnx commented Nov 2, 2011

also, this is handy for verifying that it works: https://gist.github.com/6a3f611a80b84b3b1b77

@Kami
Copy link
Member

Kami commented Nov 2, 2011

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.

@Kami
Copy link
Member

Kami commented Nov 4, 2011

Can you please close this pull request (I can't do it)?

Thanks.

@mynnx mynnx closed this Nov 7, 2011
asfgit pushed a commit that referenced this pull request Jul 31, 2023
…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
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