def destroy_dns
reply = ResultIO.new
self.class.notify_observers(:before_destroy_dns, {:application => self, :reply => reply})
dns = OpenShift::DnsService.instance
begin
dns.deregister_application(@name,@domain.namespace)
if self.scalable
self.group_instance_map.keys.each { |ginst_name|
ginst = self.group_instance_map[ginst_name]
ginst.gears.each { |gear|
dns.deregister_application(gear.name,@domain.namespace)
}
}
end
dns.publish
ensure
dns.close
end
self.class.notify_observers(:after_destroy_dns, {:application => self, :reply => reply})
reply
end