LIBCLOUD 770 wait for state#631
Conversation
Corrected dd-ap 'host'
… would want to know what that is!
There was a problem hiding this comment.
It might be a good idea to make the sleep interval configurable with a function argument.
There was a problem hiding this comment.
if we make this a bit more generic and safe (timeout, etc.) we could also consider it adding to the base NodeDriver class.
…ted on the public methods, raise error on timeout to stop infinite loop
|
Updated code to reflect comments. Agree on adding it to nodedriver, I've seen similar helper methods in libraries consuming libcloud, would need to research whether all of the drivers use the same field name (status). |
|
all done |
|
I have trouble applying the patch directly onto trunk. Can you please sync this branch with latest trunk and squash the commits? |
… commit) Squashed commit: [37abdea] return a DD exception instead of a standard error [a41b98a] take optional parameters for the timeout and polling interval, defaulted on the public methods, raise error on timeout to stop infinite loop [9be032b] VLAN has an attribute for the owning network domain, since you really would want to know what that is! [fa3a6b2] Added tests and updated arguement options (+2 squashed commit) Squashed commit: [9be032b] VLAN has an attribute for the owning network domain, since you really would want to know what that is! [fa3a6b2] Added tests and updated arguement options
…aCBUSydney/libcloud into LIBCLOUD-770_Wait_for_state
|
NTTLimitedRD@609fa85 |
|
I'm still having issues, I will manually apply it tomorrow by directly merging your branch locally :) |
Closes apache#631 Signed-off-by: Tomaz Muraus <tomaz@apache.org>
… would want to know what that is! Closes apache#631 Signed-off-by: Tomaz Muraus <tomaz@apache.org>
…ted on the public methods, raise error on timeout to stop infinite loop Closes apache#631 Signed-off-by: Tomaz Muraus <tomaz@apache.org>
Closes apache#631 Signed-off-by: Tomaz Muraus <tomaz@apache.org>
Closes apache#631 Signed-off-by: Tomaz Muraus <tomaz@apache.org>
|
Alright, I merged the changes. Thanks. Here is what I did: git fetch dd
git checkout LIBCLOUD-770_Wait_for_state
git rebase trunk -> that's the important part since it replayed your changes on top of trunk so the changes were now in the mergable order
git format-patch trunk --stdout > 1.patch
git checkout trunk
git am --signoff 1.patchI also made a small change - I supplied default value for poll_interval and timeout argument and changed exception message to also include response body - 4a74243. Let me know if the response.body change looks OK. |
|
would response.body have any value? here's an example of me using it> so ex_get_vlan returns a DimensionDataVlan object instance, which doensn't driver.ex_wait_for_state('NORMAL', driver.ex_get_vlan, result['id']) On Fri, Nov 13, 2015 at 10:06 AM, Tomaz Muraus notifications@github.com
|
|
@tonybaloney Ah, you are correct. I was confused for a second since the method is on a connection class, but it actually returns an object not the raw response from the connection class (it returns result from a calling method). I will revert that change and change variable name from |
|
Alright, I've pushed a fix in - 232f949. Another minor feature improvement would be to change the method signature to wait_for_vlan = functools.partial(self.wait_for_state, state=foo, func=self.ex_get_vlan)
vlan = wait_for_vlan(...)Or you could even modify the method to return an already partially applied function which user can use directly. |
|
my python knowledge doesn't extend that far. I was only just up to On Fri, Nov 13, 2015 at 10:35 AM, Tomaz Muraus notifications@github.com
|
|
Changes Unknown when pulling 55f24e3 on DimensionDataCBUSydney:LIBCLOUD-770_Wait_for_state into ** on apache:trunk**. |
|
If possible, it would be nice to disable coveralls who keeps posting random comments in old pull requests. |
Support for waiting for a request to reach a target state (i.e. provisioned)