1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Minor Fix to delete the internet service

This commit is contained in:
Chirag Jog 2013-02-12 18:23:39 +05:30
parent 1052a24857
commit 5542e6b8b4

View file

@ -41,6 +41,8 @@ module Fog
data = service.power_off(self.id).body data = service.power_off(self.id).body
wait_for { off? } wait_for { off? }
end end
#Failsafe .. Always check if we are ready
wait_for { ready? }
service.delete_vapp(self.id) service.delete_vapp(self.id)
true true
end end
@ -60,13 +62,13 @@ module Fog
def delete_internet_services def delete_internet_services
#Find the internet service #Find the internet service
while (service = internet_services.pop) do while (inet_service = internet_services.pop) do
nodes = service.nodeservices.all(service.Id) nodes = service.nodeservices.all(inet_service.Id)
#Delete all the associated nodes #Delete all the associated nodes
nodes.select { |item| item.destroy } nodes.select { |item| item.destroy }
#Clear out the services #Clear out the services
service.destroy(delete_public_ip = !(internet_services.size > 0)) inet_service.destroy(delete_public_ip = !(internet_services.size > 0))
end end
true true
end end