Skip to content

Commit

Permalink
Remove association to stack for disconnected VMs
Browse files Browse the repository at this point in the history
  • Loading branch information
bzwei committed Jul 8, 2015
1 parent ac2ce29 commit f7babe0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/models/vm_or_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,19 @@ def disconnect_inv
end

self.disconnect_host

disconnect_stack if respond_to?(:orchestration_stack)
end

def disconnect_stack(stack = nil)
return unless orchestration_stack
return if stack && stack != orchestration_stack

log_text = " from stack [#{orchestration_stack.name}] id [#{orchestration_stack.id}]"
_log.info "Disconnecting Vm [#{name}] id [#{id}]#{log_text}"

self.orchestration_stack = nil
save
end

def connect_ems(e)
Expand Down

0 comments on commit f7babe0

Please sign in to comment.