lib/compute.rb in forj-0.0.10 vs lib/compute.rb in forj-0.0.11
- old
+ new
@@ -63,10 +63,15 @@
:config_drive => true
)
end
def delete_instance(maestro)
- maestro = Connection.compute.servers.all(:name => maestro)[0]
- Connection.compute.servers.get(maestro.id).destroy
+ result = Connection.compute.servers.all(:name => maestro)[0]
+ name = result.name
+ if name.include? maestro
+ Connection.compute.servers.get(result.id).destroy
+ else
+ puts '%s not found' % [maestro]
+ end
end
end
\ No newline at end of file