-
Notifications
You must be signed in to change notification settings - Fork 924
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
[Libcloud-589] ProfitBricks Compute Driver Support #352
[Libcloud-589] ProfitBricks Compute Driver Support #352
Conversation
Sweet, thanks! I will try to review it asap. |
Travis build appears to be failing - https://travis-ci.org/apache/libcloud/builds/33635636 |
Thanks. Going through and correcting them now. On Tue, Aug 26, 2014 at 2:28 PM, Tomaz Muraus notifications@github.com
|
datacenter) for datacenter in object.findall('.//return')] | ||
|
||
def _to_datacenter(self, datacenter): | ||
elements = list(datacenter.iter()) |
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.
Element.iter
is not available in Python 2.6 (https://docs.python.org/2/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.iter), so please use findall
instead (datacenter.findall('.//*')
).
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.
@Kami OK, this is corrected now: all spots where I use iter are now using findall.
data=body, | ||
method='POST').object) | ||
|
||
def destroy_node(self, node, remove_attached_disks=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.
Should default to False
and not 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.
Also, it's an extension argument so it should be prefixed with ex_
.
Added some more comments. When those are addressed, please squash all the commits. |
@baldwinSPC How are things looking for those last couple of issues? I will probably be preparing a new release this weekend and it would be great if those things could get addressed so I can also include this driver. If you can't do it this weekend, let me know and I will do it myself (address those issues + squash the commits) while merging the patch. |
Hey Tomaz I've corrected about half of these. I'll commit and push those this
|
@Kami I just pushed some updates that address most of the items you called out -- there are only two remaining ones: waiting for state and re-working the ET code. |
@baldwinmathew Great, thanks. I'll work on rest of the issues and try to get it merged tonight. |
Another thing which got me confused while reviewing the changes: PROVISIONING_STATE = {
'INACTIVE': NodeState.PENDING,
'INPROCESS': NodeState.PENDING,
'AVAILABLE': NodeState.RUNNING,
'DELETED': NodeState.TERMINATED,
}
....
def _wait_for_datacenter_state(
self,
datacenter,
state=PROVISIONING_STATE.get(NodeState.RUNNING),
timeout=300,
interval=5):
Same goes with while condition - I believe the |
1. Fix "ex_describe_datacenter" to return a single object instead of a list 2. Fix "ex_describe_datacenter" method signature to take an id instead of an object 3. Fix default value for "state" argument in the "_wait_for_datacenter_state" method 4. Fix while condition in the "_wait_for_datacenter_state" method 5. Modify "_wait_for_datacenter_state" to throw an Exception on timeout 6. Do the same fixes in the "_wait_for_storage_volume_state" method 7. Fix "ex_create_datacenter" to return single object instead of a list 8. Fix "create_volume" to return a single object instead of a list 9. Fix "ex_describe_node" to return a single object instead of a list 10. Fix "create_node" to retirn a single object instead of a list 11. Fix "attach_volume" to return volume on success 12. Fix "ex_create_network_interface" to return a single object instead of a list
@baldwinSPC I performed another review. During the review I still spotted many issues (mostly with function claiming it returns a single object but it actually returned a list) which I have fixed in my branch - Kami@28e9774 I would appreciate if you can go over my fixes, double check them and test them with the actual Profitbricks API (I don't have an account). Thanks! |
@Kami Great. Thanks Tomaz. I will be testing through this tomorrow morning and will update this thread. |
Various fixes in the Profitbricks driver:
@Kami I just merged your branch into mine after testing all the methods live against the API. Everything looks good, however, in my testing I caught two bugs due to empty data coming back from their API. Those are two minor changes you should see on my next commit. |
@Kami BTW, thank you for all your support. :) |
@baldwinmathew Great and you are welcome. I will look into your changes and and look into merging this pull request into trunk this weekend :) |
Looks good. I've made "a bunch of ifs" to "for loop" change and merged patch into trunk. Thanks! |
I have completed support for the ProfitBricks compute driver. This adds support for the core compute driver functions against ProfitBricks. The JIRA ticket can be found here:
https://issues.apache.org/jira/browse/LIBCLOUD-589
Let me know if there are any issues or if it can be accepted or not.
Thanks.
-matt