You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2015/10/26 15:19:22 UTC

[13/17] ambari git commit: AMBARI-12701. Addendum for patch. Stop-and-Start Upgrade: Handle Core Services (alejandro)

AMBARI-12701. Addendum for patch. Stop-and-Start Upgrade: Handle Core Services (alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 16a457543208fd54329de9f4f42f445965f787a0
Parents: 0a1bb11
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Sat Oct 24 23:04:23 2015 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Sat Oct 24 23:05:25 2015 -0700

----------------------------------------------------------------------
 .../resource_management/libraries/script/script.py    | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/16a45754/ambari-common/src/main/python/resource_management/libraries/script/script.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index e3bae5d..79bc535 100644
--- a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -487,10 +487,13 @@ class Script(object):
     else:
       # To remain backward compatible with older stacks, only pass upgrade_type if available.
       # TODO, remove checking the argspec for "upgrade_type" once all of the services support that optional param.
-      if is_stack_upgrade and "upgrade_type" in inspect.getargspec(self.stop).args:
+      if "upgrade_type" in inspect.getargspec(self.stop).args:
         self.stop(env, upgrade_type=upgrade_type)
       else:
-        self.stop(env, rolling_restart=(restart_type == "rolling_upgrade"))
+        if is_stack_upgrade:
+          self.stop(env, rolling_restart=(restart_type == "rolling_upgrade"))
+        else:
+          self.stop(env)
 
       if is_stack_upgrade:
         # Remain backward compatible with the rest of the services that haven't switched to using
@@ -502,10 +505,13 @@ class Script(object):
 
       # To remain backward compatible with older stacks, only pass upgrade_type if available.
       # TODO, remove checking the argspec for "upgrade_type" once all of the services support that optional param.
-      if is_stack_upgrade and "upgrade_type" in inspect.getargspec(self.start).args:
+      if "upgrade_type" in inspect.getargspec(self.start).args:
         self.start(env, upgrade_type=upgrade_type)
       else:
-        self.start(env, rolling_restart=(restart_type == "rolling_upgrade"))
+        if is_stack_upgrade:
+          self.start(env, rolling_restart=(restart_type == "rolling_upgrade"))
+        else:
+          self.start(env)
 
       if is_stack_upgrade:
         # Remain backward compatible with the rest of the services that haven't switched to using