vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.22 vs vmc-ng/lib/vmc/cli/app.rb in vmc-0.4.0.beta.23

- old
+ new

@@ -368,11 +368,11 @@ end end unless deleted.empty? delete_orphaned_services( - find_orphaned_services(deleted), + find_orphaned_services(deleted, apps - deleted), input[:orphaned]) end end @@ -908,21 +908,21 @@ if c = i.console puts " console: port #{b(c[:port])} at #{b(c[:ip])}" end end - def find_orphaned_services(apps) + def find_orphaned_services(apps, others = []) orphaned = [] apps.each do |a| a.services.each do |i| - if apps.none? { |x| x != a && x.services.include?(i) } + if others.none? { |x| x.binds?(i) } orphaned << i end end end - orphaned + orphaned.each(&:invalidate!) end def delete_orphaned_services(instances, orphaned) return if instances.empty?