|
51 | 51 | import com.cloud.agent.api.ShutdownCommand; |
52 | 52 | import com.cloud.agent.api.StartupAnswer; |
53 | 53 | import com.cloud.agent.api.StartupCommand; |
54 | | -import com.cloud.agent.api.UpgradeAnswer; |
55 | | -import com.cloud.agent.api.UpgradeCommand; |
56 | 54 | import com.cloud.agent.transport.Request; |
57 | 55 | import com.cloud.agent.transport.Response; |
58 | 56 | import com.cloud.exception.AgentControlChannelException; |
@@ -482,9 +480,6 @@ protected void processRequest(final Request request, final Link link) { |
482 | 480 | final CronCommand watch = (CronCommand) cmd; |
483 | 481 | scheduleWatch(link, request, watch.getInterval() * 1000, watch.getInterval() * 1000); |
484 | 482 | answer = new Answer(cmd, true, null); |
485 | | - } else if (cmd instanceof UpgradeCommand) { |
486 | | - final UpgradeCommand upgrade = (UpgradeCommand) cmd; |
487 | | - answer = upgradeAgent(upgrade.getUpgradeUrl(), upgrade); |
488 | 483 | } else if (cmd instanceof ShutdownCommand) { |
489 | 484 | ShutdownCommand shutdown = (ShutdownCommand) cmd; |
490 | 485 | s_logger.debug("Received shutdownCommand, due to: " + shutdown.getReason()); |
@@ -649,25 +644,6 @@ public void processOtherTask(Task task) { |
649 | 644 | } |
650 | 645 | } |
651 | 646 |
|
652 | | - protected UpgradeAnswer upgradeAgent(final String url, final UpgradeCommand cmd) { |
653 | | - try { |
654 | | - upgradeAgent(url, cmd == null); |
655 | | - return null; |
656 | | - } catch (final Exception e) { |
657 | | - s_logger.error("Unable to run this agent because we couldn't complete the upgrade process.", e); |
658 | | - if (cmd != null) { |
659 | | - final StringWriter writer = new StringWriter(); |
660 | | - writer.append(e.getMessage()); |
661 | | - writer.append("===>Stack<==="); |
662 | | - e.printStackTrace(new PrintWriter(writer)); |
663 | | - return new UpgradeAnswer(cmd, writer.toString()); |
664 | | - } |
665 | | - |
666 | | - System.exit(3); |
667 | | - return null; |
668 | | - } |
669 | | - } |
670 | | - |
671 | 647 | public synchronized void setLastPingResponseTime() { |
672 | 648 | _lastPingResponseTime = System.currentTimeMillis(); |
673 | 649 | } |
|
0 commit comments