Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Bug 1101499: Stopping secondary gear after restore snapshot for scale…
Browse files Browse the repository at this point in the history
…able app
  • Loading branch information
jhadvig committed May 30, 2014
1 parent fab8b89 commit da7e8c8
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -206,7 +206,11 @@ def restore(restore_git_repo, report_deployment)
# Revert to the pre-restore state of the currently restored gear
#
if @state.value != pre_restore_state
(@state.value != State::STARTED) ? start_gear : stop_gear
if (@state.value != State::STARTED)
start_gear
else
scalable_restore ? post_restore_stop_gears(gear_groups, gear_env) : stop_gear
end
end

result[:status] = RESULT_SUCCESS
Expand Down Expand Up @@ -311,6 +315,14 @@ def handle_scalable_restore(gear_groups, gear_env)
expected_exitstatus: 0)
end
end

def post_restore_stop_gears(gear_groups, gear_env)
$stderr.puts "Stopping gears after restore "
gear_groups['data'][0]['gears'].each do |gear|
ssh_coords = gear['ssh_url'].sub(/^ssh:\/\//, '')
run_in_container_context("#{::OpenShift::Runtime::ApplicationContainer::GEAR_TO_GEAR_SSH} #{ssh_coords} 'gear stop'", env: gear_env )
end
end
end
end
end
Expand Down

0 comments on commit da7e8c8

Please sign in to comment.