Updated Branches:
  refs/heads/master aaaf168f5 -> b9972e587

agent: Remove the UpgradeCommand and Answer

This isn't used and handled by the DEB and RPM packaging.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b9972e58
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b9972e58
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b9972e58

Branch: refs/heads/master
Commit: b9972e587cd83769f8e2172eb372809f9358fff8
Parents: aaaf168
Author: Wido den Hollander <[email protected]>
Authored: Fri Jul 12 14:22:07 2013 +0200
Committer: Wido den Hollander <[email protected]>
Committed: Fri Jul 12 14:24:40 2013 +0200

----------------------------------------------------------------------
 agent/src/com/cloud/agent/Agent.java            | 24 -----------
 core/src/com/cloud/agent/api/UpgradeAnswer.java | 26 ------------
 .../src/com/cloud/agent/api/UpgradeCommand.java | 42 --------------------
 3 files changed, 92 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9972e58/agent/src/com/cloud/agent/Agent.java
----------------------------------------------------------------------
diff --git a/agent/src/com/cloud/agent/Agent.java 
b/agent/src/com/cloud/agent/Agent.java
index 84b0db6..28d0470 100755
--- a/agent/src/com/cloud/agent/Agent.java
+++ b/agent/src/com/cloud/agent/Agent.java
@@ -51,8 +51,6 @@ import com.cloud.agent.api.ReadyCommand;
 import com.cloud.agent.api.ShutdownCommand;
 import com.cloud.agent.api.StartupAnswer;
 import com.cloud.agent.api.StartupCommand;
-import com.cloud.agent.api.UpgradeAnswer;
-import com.cloud.agent.api.UpgradeCommand;
 import com.cloud.agent.transport.Request;
 import com.cloud.agent.transport.Response;
 import com.cloud.exception.AgentControlChannelException;
@@ -482,9 +480,6 @@ public class Agent implements HandlerFactory, IAgentControl 
{
                         final CronCommand watch = (CronCommand) cmd;
                         scheduleWatch(link, request, watch.getInterval() * 
1000, watch.getInterval() * 1000);
                         answer = new Answer(cmd, true, null);
-                    } else if (cmd instanceof UpgradeCommand) {
-                        final UpgradeCommand upgrade = (UpgradeCommand) cmd;
-                        answer = upgradeAgent(upgrade.getUpgradeUrl(), 
upgrade);
                     } else if (cmd instanceof ShutdownCommand) {
                         ShutdownCommand shutdown = (ShutdownCommand) cmd;
                         s_logger.debug("Received shutdownCommand, due to: " + 
shutdown.getReason());
@@ -649,25 +644,6 @@ public class Agent implements HandlerFactory, 
IAgentControl {
         }
     }
 
-    protected UpgradeAnswer upgradeAgent(final String url, final 
UpgradeCommand cmd) {
-        try {
-            upgradeAgent(url, cmd == null);
-            return null;
-        } catch (final Exception e) {
-            s_logger.error("Unable to run this agent because we couldn't 
complete the upgrade process.", e);
-            if (cmd != null) {
-                final StringWriter writer = new StringWriter();
-                writer.append(e.getMessage());
-                writer.append("===>Stack<===");
-                e.printStackTrace(new PrintWriter(writer));
-                return new UpgradeAnswer(cmd, writer.toString());
-            }
-
-            System.exit(3);
-            return null;
-        }
-    }
-
     public synchronized void setLastPingResponseTime() {
         _lastPingResponseTime = System.currentTimeMillis();
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9972e58/core/src/com/cloud/agent/api/UpgradeAnswer.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UpgradeAnswer.java 
b/core/src/com/cloud/agent/api/UpgradeAnswer.java
deleted file mode 100644
index 00b0f25..0000000
--- a/core/src/com/cloud/agent/api/UpgradeAnswer.java
+++ /dev/null
@@ -1,26 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.agent.api;
-
-public class UpgradeAnswer extends Answer {
-    protected UpgradeAnswer() {
-    }
-
-    public UpgradeAnswer(UpgradeCommand cmd, String failure) {
-        super(cmd, false, failure);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b9972e58/core/src/com/cloud/agent/api/UpgradeCommand.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/UpgradeCommand.java 
b/core/src/com/cloud/agent/api/UpgradeCommand.java
deleted file mode 100644
index 0e1b6d2..0000000
--- a/core/src/com/cloud/agent/api/UpgradeCommand.java
+++ /dev/null
@@ -1,42 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.agent.api;
-
-/**
- * UpgradeCommand is sent when the agent should update.
- */
-public class UpgradeCommand extends Command {
-
-    String url;
-
-    protected UpgradeCommand() {
-    }
-
-    public UpgradeCommand(String url) {
-        this.url = url;
-    }
-
-    public String getUpgradeUrl() {
-        return url;
-    }
-
-    @Override
-    public boolean executeInSequence() {
-        return true;
-    }
-
-}

Reply via email to