ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mug...@apache.org
Subject ambari git commit: AMBARI-22204 Updating Ranger Admin pre-upgrade task (mugdha)
Date Thu, 12 Oct 2017 09:07:05 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 5de82da3b -> 3acfa5c12


AMBARI-22204 Updating Ranger Admin pre-upgrade task (mugdha)


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

Branch: refs/heads/trunk
Commit: 3acfa5c12708ff00c896943cd44e81b0a9ec85d1
Parents: 5de82da
Author: Mugdha Varadkar <mugdha@apache.org>
Authored: Thu Oct 12 14:26:43 2017 +0530
Committer: Mugdha Varadkar <mugdha@apache.org>
Committed: Thu Oct 12 14:35:59 2017 +0530

----------------------------------------------------------------------
 .../0.4.0/package/scripts/ranger_admin.py       | 23 +++++++++++++++----
 .../0.4.0/package/scripts/ranger_tagsync.py     | 23 +++++++++++++++----
 .../1.0.0.3.0/package/scripts/ranger_admin.py   | 24 +++++++++++++++-----
 .../1.0.0.3.0/package/scripts/ranger_tagsync.py | 23 +++++++++++++++----
 4 files changed, 75 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3acfa5c1/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
index 848b137..d0a725a 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_admin.py
@@ -20,6 +20,7 @@ limitations under the License.
 from resource_management.core.exceptions import Fail
 from resource_management.libraries.functions.check_process_status import check_process_status
 from resource_management.libraries.functions import stack_select
+from resource_management.libraries.functions import upgrade_summary
 from resource_management.libraries.script import Script
 from resource_management.core.resources.system import Execute, File
 from resource_management.core.exceptions import ComponentIsNotRunning
@@ -199,11 +200,25 @@ class RangerAdmin(Script):
     import params
     env.set_params(params)
 
-    upgrade_stack = stack_select._get_upgrade_stack()
-    if upgrade_stack is None:
-      raise Fail('Unable to determine the stack and stack version')
+    orchestration = stack_select.PACKAGE_SCOPE_STANDARD
+    summary = upgrade_summary.get_upgrade_summary()
 
-    stack_select.select_packages(params.version)
+    if summary is not None:
+      orchestration = summary.orchestration
+      if orchestration is None:
+        raise Fail("The upgrade summary does not contain an orchestration type")
+
+      if orchestration.upper() in stack_select._PARTIAL_ORCHESTRATION_SCOPES:
+        orchestration = stack_select.PACKAGE_SCOPE_PATCH
+
+    stack_select_packages = stack_select.get_packages(orchestration, service_name = "RANGER",
component_name = "RANGER_ADMIN")
+    if stack_select_packages is None:
+      raise Fail("Unable to get packages for stack-select")
+
+    Logger.info("RANGER_ADMIN component will be stack-selected to version {0} using a {1}
orchestration".format(params.version, orchestration.upper()))
+
+    for stack_select_package_name in stack_select_packages:
+      stack_select.select(stack_select_package_name, params.version)
 
   def get_log_folder(self):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/3acfa5c1/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
index 3aae8ff..b1a1819 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/ranger_tagsync.py
@@ -19,6 +19,7 @@ limitations under the License.
 """
 from resource_management.libraries.script import Script
 from resource_management.libraries.functions import stack_select
+from resource_management.libraries.functions import upgrade_summary
 from resource_management.core.resources.system import Execute, File
 from resource_management.libraries.functions.check_process_status import check_process_status
 from resource_management.core.exceptions import ComponentIsNotRunning
@@ -102,11 +103,25 @@ class RangerTagsync(Script):
     import params
     env.set_params(params)
 
-    upgrade_stack = stack_select._get_upgrade_stack()
-    if upgrade_stack is None:
-      raise Fail('Unable to determine the stack and stack version')
+    orchestration = stack_select.PACKAGE_SCOPE_STANDARD
+    summary = upgrade_summary.get_upgrade_summary()
 
-    stack_select.select_packages(params.version)
+    if summary is not None:
+      orchestration = summary.orchestration
+      if orchestration is None:
+        raise Fail("The upgrade summary does not contain an orchestration type")
+
+      if orchestration.upper() in stack_select._PARTIAL_ORCHESTRATION_SCOPES:
+        orchestration = stack_select.PACKAGE_SCOPE_PATCH
+
+    stack_select_packages = stack_select.get_packages(orchestration, service_name = "RANGER",
component_name = "RANGER_TAGSYNC")
+    if stack_select_packages is None:
+      raise Fail("Unable to get packages for stack-select")
+
+    Logger.info("RANGER_TAGSYNC component will be stack-selected to version {0} using a {1}
orchestration".format(params.version, orchestration.upper()))
+
+    for stack_select_package_name in stack_select_packages:
+      stack_select.select(stack_select_package_name, params.version)
 
     if params.stack_supports_ranger_tagsync_ssl_xml_support:
       Logger.info("Upgrading Tagsync, stack support Atlas user for Tagsync, creating keystore
for same.")

http://git-wip-us.apache.org/repos/asf/ambari/blob/3acfa5c1/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_admin.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_admin.py
b/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_admin.py
index a9e2857..777e95d 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_admin.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_admin.py
@@ -20,6 +20,7 @@ limitations under the License.
 from resource_management.core.exceptions import Fail
 from resource_management.libraries.functions.check_process_status import check_process_status
 from resource_management.libraries.functions import stack_select
+from resource_management.libraries.functions import upgrade_summary
 from resource_management.libraries.functions.constants import Direction
 from resource_management.libraries.script import Script
 from resource_management.core.resources.system import Execute, File
@@ -184,14 +185,25 @@ class RangerAdmin(Script):
     import params
     env.set_params(params)
 
-    upgrade_stack = stack_select._get_upgrade_stack()
-    if upgrade_stack is None:
-      raise Fail('Unable to determine the stack and stack version')
+    orchestration = stack_select.PACKAGE_SCOPE_STANDARD
+    summary = upgrade_summary.get_upgrade_summary()
 
-    stack_name = upgrade_stack[0]
-    stack_version = upgrade_stack[1]
+    if summary is not None:
+      orchestration = summary.orchestration
+      if orchestration is None:
+        raise Fail("The upgrade summary does not contain an orchestration type")
+
+      if orchestration.upper() in stack_select._PARTIAL_ORCHESTRATION_SCOPES:
+        orchestration = stack_select.PACKAGE_SCOPE_PATCH
+
+    stack_select_packages = stack_select.get_packages(orchestration, service_name = "RANGER",
component_name = "RANGER_ADMIN")
+    if stack_select_packages is None:
+      raise Fail("Unable to get packages for stack-select")
+
+    Logger.info("RANGER_ADMIN component will be stack-selected to version {0} using a {1}
orchestration".format(params.version, orchestration.upper()))
 
-    stack_select.select_packages(params.version)
+    for stack_select_package_name in stack_select_packages:
+      stack_select.select(stack_select_package_name, params.version)
 
   def get_log_folder(self):
     import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/3acfa5c1/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_tagsync.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_tagsync.py
b/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_tagsync.py
index 85963cf..92e0165 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_tagsync.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/1.0.0.3.0/package/scripts/ranger_tagsync.py
@@ -19,6 +19,7 @@ limitations under the License.
 """
 from resource_management.libraries.script import Script
 from resource_management.libraries.functions import stack_select
+from resource_management.libraries.functions import upgrade_summary
 from resource_management.core.resources.system import Execute, File
 from resource_management.libraries.functions.check_process_status import check_process_status
 from resource_management.core.exceptions import ComponentIsNotRunning
@@ -104,11 +105,25 @@ class RangerTagsync(Script):
     import params
     env.set_params(params)
 
-    upgrade_stack = stack_select._get_upgrade_stack()
-    if upgrade_stack is None:
-      raise Fail('Unable to determine the stack and stack version')
+    orchestration = stack_select.PACKAGE_SCOPE_STANDARD
+    summary = upgrade_summary.get_upgrade_summary()
 
-    stack_select.select_packages(params.version)
+    if summary is not None:
+      orchestration = summary.orchestration
+      if orchestration is None:
+        raise Fail("The upgrade summary does not contain an orchestration type")
+
+      if orchestration.upper() in stack_select._PARTIAL_ORCHESTRATION_SCOPES:
+        orchestration = stack_select.PACKAGE_SCOPE_PATCH
+
+    stack_select_packages = stack_select.get_packages(orchestration, service_name = "RANGER",
component_name = "RANGER_TAGSYNC")
+    if stack_select_packages is None:
+      raise Fail("Unable to get packages for stack-select")
+
+    Logger.info("RANGER_TAGSYNC component will be stack-selected to version {0} using a {1}
orchestration".format(params.version, orchestration.upper()))
+
+    for stack_select_package_name in stack_select_packages:
+      stack_select.select(stack_select_package_name, params.version)
 
     if params.stack_supports_ranger_tagsync_ssl_xml_support:
       Logger.info("Upgrading Tagsync, stack support Atlas user for Tagsync, creating keystore
for same.")


Mime
View raw message