Repository: incubator-slider
Updated Branches:
  refs/heads/develop 7ae7d1532 -> 9f004e01c


SLIDER-787 App Upgrade/Reconfig support in Slider (allow app configs with no 
app_version)


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/9f004e01
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/9f004e01
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/9f004e01

Branch: refs/heads/develop
Commit: 9f004e01c41088134d25f142cb3b4af195c84ffe
Parents: 7ae7d15
Author: Gour Saha <[email protected]>
Authored: Tue Apr 7 13:55:21 2015 -0700
Committer: Gour Saha <[email protected]>
Committed: Tue Apr 7 13:55:21 2015 -0700

----------------------------------------------------------------------
 slider-agent/src/main/python/agent/Controller.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/9f004e01/slider-agent/src/main/python/agent/Controller.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/main/python/agent/Controller.py 
b/slider-agent/src/main/python/agent/Controller.py
index 22c5e25..2d823b5 100644
--- a/slider-agent/src/main/python/agent/Controller.py
+++ b/slider-agent/src/main/python/agent/Controller.py
@@ -250,10 +250,12 @@ class Controller(threading.Thread):
     '''
     Store app root and version for upgrade:
     '''
-    if (self.appRoot is None):
-      self.appRoot = command['configurations']['global']['app_root']
-    if (self.appVersion is None):
-      self.appVersion = command['configurations']['global']['app_version']
+    if self.appRoot is None:
+      if 'app_root' in command['configurations']['global']:
+        self.appRoot = command['configurations']['global']['app_root']
+    if self.appVersion is None:
+      if 'app_version' in command['configurations']['global']:
+        self.appVersion = command['configurations']['global']['app_version']
 
   def heartbeatWithServer(self):
     self.DEBUG_HEARTBEAT_RETRIES = 0
@@ -473,8 +475,8 @@ class Controller(threading.Thread):
         during upgrade (if performed).
         '''
         self.storeAppRootAndVersion(command)
-        logger.info("Stored appRoot = " + self.appRoot)
-        logger.info("Stored appVersion = " + self.appVersion)
+        logger.info("Stored appRoot = %s", (self.appRoot))
+        logger.info("Stored appVersion = %s", (self.appVersion))
         break;
 
       if command["roleCommand"] == "UPGRADE":

Reply via email to