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

[LIBCLOUD-723] Added cloud specific parameter to base compute wait_un… #548

Closed

Conversation

davidwilson2038
Copy link
Contributor

Fixed LIBCLOUD-723 bug with Azure driver where the wait_until_running method is broken because it calls self.list_nodes() without any options (list_nodes is defined as requiring an ex_cloud_service parameter). I added an optional ex_cloud_opts parameter to the wait_until_running method to make it work and also allow users of other drivers to specify additional configuration parameters if their list_nodes function allows.

…til_running method to make compatible with Azure
@Kami
Copy link
Member

Kami commented Jul 19, 2015

@davidwilson2038 Good catch and thanks.

@@ -1260,8 +1260,9 @@ def delete_key_pair(self, key_pair):
raise NotImplementedError(
'delete_key_pair not implemented for this driver')

def wait_until_running(self, nodes, wait_period=3, timeout=600,
ssh_interface='public_ips', force_ipv4=True):
def wait_until_running(self, nodes, ex_cloud_opts=None, wait_period=3,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move this new argument to the end so it's the last argument?

This way the change is backward compatible and doesn't break existing code if using non keyword arguments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a docstring which explains what this argument does.

Edit: Never mind, I see the docstring is already there.

ssh_interface='public_ips', force_ipv4=True):
def wait_until_running(self, nodes, wait_period=3,
timeout=600, ssh_interface='public_ips',
force_ipv4=True, **ex_list_nodes_kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be no ** here since user should pass in a dict to the function. I will remove it when merging the patch.

@asfgit asfgit closed this in 4cc3adf Aug 7, 2015
@Kami
Copy link
Member

Kami commented Aug 7, 2015

Made this method signature fix (4cc3adf) and merged changes into trunk.

Thanks.

@Kami
Copy link
Member

Kami commented Aug 7, 2015

@davidwilson2038 On a related note - Now that this is merged into trunk, you can also override wait_until_running method in the Azure driver - you can simply call parent class method with the correct ex_list_nodes_kwargs argument.

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.

None yet

2 participants