def pre_move_cart(cart, gear, leave_stopped, keep_uid)
reply = ResultIO.new
app = gear.app
unless leave_stopped
log_debug "DEBUG: Stopping existing app cartridge '#{cart}' before moving"
do_with_retry('stop') do
reply.append gear.get_proxy.stop(gear.app, gear, cart)
end
if framework_carts.include? cart
log_debug "DEBUG: Force stopping existing app cartridge '#{cart}' before moving"
do_with_retry('force-stop') do
reply.append gear.get_proxy.force_stop(app, gear, cart)
end
end
end
if embedded_carts.include? cart and not keep_uid
if (app.scalable and not cart.include? app.proxy_cartridge) or not app.scalable
log_debug "DEBUG: Performing cartridge level pre-move for embedded #{cart} for '#{app.name}' on #{gear.name}"
reply.append gear.get_proxy.send(:run_cartridge_command, "embedded/" + cart, app, gear, "pre-move", nil, false)
end
end
end