def post_move_cart(cart, gear, keep_uid, idle)
reply = ResultIO.new
app = gear.app
if embedded_carts.include? cart
if app.scalable and cart.include? app.proxy_cartridge
log_debug "DEBUG: Performing cartridge level move for '#{cart}' on #{gear.name}"
reply.append gear.get_proxy.send(:run_cartridge_command, cart, app, gear, "move", idle ? '--idle' : nil, false)
else
log_debug "DEBUG: Performing cartridge level move for embedded #{cart} for '#{app.name}' on #{gear.name}"
embedded_reply = gear.get_proxy.send(:run_cartridge_command, "embedded/" + cart, app, gear, "move", nil, false)
component_details = embedded_reply.appInfoIO.string
unless component_details.empty?
app.set_embedded_cart_info(cart, component_details)
end
reply.append embedded_reply
unless keep_uid
log_debug "DEBUG: Performing cartridge level post-move for embedded #{cart} for '#{app.name}' on #{gear.name}"
reply.append gear.get_proxy.send(:run_cartridge_command, "embedded/" + cart, app, gear, "post-move", nil, false)
end
end
end
if framework_carts.include? cart
log_debug "DEBUG: Performing cartridge level move for '#{cart}' on #{gear.name}"
reply.append gear.get_proxy.send(:run_cartridge_command, cart, app, gear, "move", idle ? '--idle' : nil, false)
end
if app.scalable and not cart.include? app.proxy_cartridge
begin
reply.append gear.get_proxy.expose_port(app, gear, cart)
rescue Exception=>e
end
end
end