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

KNIFE-477: Delete server by name if instance_id isn't found #111

Merged
merged 2 commits into from
Jun 2, 2014

Conversation

ameyavarade
Copy link
Contributor

It uses knife-cloud change: chef/knife-cloud#67
@kaustubh-d

@@ -36,6 +36,22 @@ def initialize(options = {})
def add_api_endpoint
@auth_params.merge!({:openstack_auth_url => Chef::Config[:knife][:api_endpoint]}) unless Chef::Config[:knife][:api_endpoint].nil?
end

def get_server(search_term)
if server = connection.servers.get(search_term)
Copy link
Contributor

Choose a reason for hiding this comment

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

servers.get(search_term) might raise some exceptions which needs to be handled here. Plus you are overriding the get_server(arg) method from fog/service.rb here. If you are overriding on purpose then you can use some exception handling except( Excon::Errors::BadRequest ) or you can rename the method.

https://github.com/opscode/knife-cloud/blob/master/lib/chef/knife/cloud/fog/service.rb#L137

kaustubh-d added a commit that referenced this pull request Jun 2, 2014
[knife-cloud] KNIFE-477: Delete server by name if instance_id isn't found
@kaustubh-d kaustubh-d merged commit c07ac38 into knife-cloud Jun 2, 2014
@jjasghar jjasghar deleted the ameya-server-delete-by-name branch April 17, 2015 16:02
@tas50 tas50 changed the title [knife-cloud] KNIFE-477: Delete server by name if instance_id isn't found KNIFE-477: Delete server by name if instance_id isn't found Dec 12, 2016
@tas50 tas50 added Type: Enhancement Adds new functionality. and removed Enhancement labels Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants