-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add latent buildslave for OpenStack #666
Conversation
The buildslave has limited functionality for interacting with OpenStack's Nova component. Booting and terminating instances works correctly, but no interfacing with the network part.
@@ -0,0 +1,181 @@ | |||
# This file is part of Buildbot. Buildbot is free software: you can |
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.
I know this is different from the other latent buildslaves, but I'd like to start moving things to the buildbot.buildslave
package. Could you rename to master/buildbot/buildslave/openstack.py
, and make the similar rename for the tests?
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.
very quick shipping, item as described
Chanel bags http://www.assureur-ideal.com/Chanel-Handbags/
Otherwise, please add docs and an entry to the release notes. Thanks! |
I'm happy. @tomprince is going to have a look shortly. |
def _get_image(self, os_client): | ||
# If self.image is a callable, then pass it the list of images. The | ||
# function should return the image's UUID to use. | ||
if hasattr(self.image, '__call__'): |
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 should be if callable(...):
. And it should document the fact that it is calls the function in a thread (or maybe be run in the main thread).
I'm not sure what the use case is, so I don't know if this will likely call into the synchronous client library.
We use camelCase rather than underscore (following twisted). (We do use underscores occasionaly, in naming test methods, as a phrase seperator. |
self.patch(openstack, "nce", None) | ||
self.patch(openstack, "client", None) | ||
self.assertRaises(config.ConfigErrors, self.ConcreteBuildSlave, | ||
'bot', 'pass', 'flavor', 'image', 'user', 'pass', 'tenant', 'auth') |
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.
Id be happier if these passed arguments as keyword arguments. Given the number of arguments, users should be passing them that way.
It would be nice if the fakes tracked the calls with side-effects, and then made assertions about them. |
Not using an abstract slave, so do not need a concrete version. Some of the lines are a bit long; this will be fixed later.
Due to the number of required arguments, use keywords for them to be clearer about what's being specified. Also changed the flavor to be an integer because the docs say to pass the flavor ID, not name.
Use keyword arguments in the examples and list the keyword arguments with a brief description on each.
@tomprince, please have a look at the updates here when you're back on dry land. |
The instance name was included in the log message, but this is identical to the slave name. Instead, include the image UUID as this could actually help in debugging.
@tomprince - ping? |
I'm going to get this merged. @tomprince, please have a look when you get a chance and we can fix any problems post-merge. |
# started. | ||
return defer.succeed(None) | ||
instance = self.instance | ||
self.instance = None |
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.
stop_instance can be called from the reactor right? If so, I dont think unseating self.instance is right, as that could make the worker thread crash, which references self.instance in a few places.
The buildslave has limited functionality for interacting with OpenStack's Nova component. Booting and terminating instances works correctly, but no interfacing with the network part.