Skip to content

Commit b9972e5

Browse files
committed
agent: Remove the UpgradeCommand and Answer
This isn't used and handled by the DEB and RPM packaging.
1 parent aaaf168 commit b9972e5

3 files changed

Lines changed: 0 additions & 92 deletions

File tree

agent/src/com/cloud/agent/Agent.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
import com.cloud.agent.api.ShutdownCommand;
5252
import com.cloud.agent.api.StartupAnswer;
5353
import com.cloud.agent.api.StartupCommand;
54-
import com.cloud.agent.api.UpgradeAnswer;
55-
import com.cloud.agent.api.UpgradeCommand;
5654
import com.cloud.agent.transport.Request;
5755
import com.cloud.agent.transport.Response;
5856
import com.cloud.exception.AgentControlChannelException;
@@ -482,9 +480,6 @@ protected void processRequest(final Request request, final Link link) {
482480
final CronCommand watch = (CronCommand) cmd;
483481
scheduleWatch(link, request, watch.getInterval() * 1000, watch.getInterval() * 1000);
484482
answer = new Answer(cmd, true, null);
485-
} else if (cmd instanceof UpgradeCommand) {
486-
final UpgradeCommand upgrade = (UpgradeCommand) cmd;
487-
answer = upgradeAgent(upgrade.getUpgradeUrl(), upgrade);
488483
} else if (cmd instanceof ShutdownCommand) {
489484
ShutdownCommand shutdown = (ShutdownCommand) cmd;
490485
s_logger.debug("Received shutdownCommand, due to: " + shutdown.getReason());
@@ -649,25 +644,6 @@ public void processOtherTask(Task task) {
649644
}
650645
}
651646

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-
671647
public synchronized void setLastPingResponseTime() {
672648
_lastPingResponseTime = System.currentTimeMillis();
673649
}

core/src/com/cloud/agent/api/UpgradeAnswer.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

core/src/com/cloud/agent/api/UpgradeCommand.java

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)