From b15682eb692db142058f33cd7f7ffa7936a700de Mon Sep 17 00:00:00 2001 From: Paul Morie Date: Mon, 29 Jul 2013 14:59:26 -0400 Subject: [PATCH] Fix bug 981584: skip restore for secondary gear group in scalable app if there is no appropriate snapshot --- .../model/application_container_ext/snapshots.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node/lib/openshift-origin-node/model/application_container_ext/snapshots.rb b/node/lib/openshift-origin-node/model/application_container_ext/snapshots.rb index 2cdc4ae1b1c..02a99651974 100644 --- a/node/lib/openshift-origin-node/model/application_container_ext/snapshots.rb +++ b/node/lib/openshift-origin-node/model/application_container_ext/snapshots.rb @@ -211,6 +211,11 @@ def handle_scalable_restore(gear_groups, gear_env) secondary_groups = get_secondary_gear_groups(gear_groups) secondary_groups.each do |type, group| + if !File.exists?(PathUtils.join(container_dir, %W(app-root data #{type}.tar.gz))) + $stderr.puts "Unable to restore #{type} because it appears there is no snapshot for that type" + next + end + $stderr.puts "Restoring snapshot for #{type} gear" ssh_coords = group['gears'][0]['ssh_url'].sub(/^ssh:\/\//, '')