ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alejan...@apache.org
Subject ambari git commit: ADDENDUM. AMBARI-17783. Add falcon to oozie admin user for HDP 2.5 (Venkat Ranganathan via alejandro)
Date Thu, 21 Jul 2016 18:45:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 0d39d996c -> 2d9a27245


ADDENDUM. AMBARI-17783. Add falcon to oozie admin user for HDP 2.5 (Venkat Ranganathan via
alejandro)


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

Branch: refs/heads/branch-2.4
Commit: 2d9a27245a0c95e49d2789c9753dd44bdc8be346
Parents: 0d39d99
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Thu Jul 21 11:46:55 2016 -0700
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Thu Jul 21 11:48:20 2016 -0700

----------------------------------------------------------------------
 .../stacks/HDP/2.5/services/stack_advisor.py    | 36 +++++++++++++++-----
 1 file changed, 27 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2d9a2724/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
index ba9af11..a7eed00 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
@@ -36,16 +36,34 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
   def recommendOozieConfigurations(self, configurations, clusterData, services, hosts):
     super(HDP25StackAdvisor,self).recommendOozieConfigurations(configurations, clusterData,
services, hosts)
     putOozieEnvProperty = self.putProperty(configurations, "oozie-env", services)
-    if "FALCON_SERVER" in clusterData["components"] :
-      if "falcon-env" in services["configurations"] and "falcon_user" \
-          in services["configurations"]["falcon-env"]["properties"] :
-        falconUser = services["configurations"]["falcon-env"]["properties"]["falcon_user"]
-      else :
-        falconUser = 'falcon'
+    if not "FALCON_SERVER" in clusterData["components"] :
+      print "Falcon is not part of the installation"
+      return
+
+    if not "oozie-env" in services["configurations"] :
+      print "No oozie env in configurations"
+      return
+
+    if "falcon-env" in services["configurations"] and "falcon_user" \
+        in services["configurations"]["falcon-env"]["properties"] :
+      falconUser = services["configurations"]["falcon-env"]["properties"]["falcon_user"]
+      print "Falcon user from configuration " + falconUser
+    else :
+      falconUser = 'falcon'
+      print "Defaulting falcon user to " + falconUser
+
+    if "oozie_user" \
+      in services["configurations"]["oozie-env"]["properties"] :
       oozieUser = services["configurations"]["oozie-env"]["properties"]["oozie_user"]
-      newAdminUsers = "{0},oozie-admin,{1}".format(oozieUser, falconUser)
-      services["forced-configurations"].append({"type" : "oozie-env", "name" : "oozie_admin_users"})
-      putOozieEnvProperty("oozie_admin_users", newAdminUsers)
+      print "Oozie user from configuration " + oozieUser
+    else :
+      oozieUser = 'oozie'
+      print "Defaulting oozie user to " + oozieUser
+
+    newAdminUsers = "{0},oozie-admin,{1}".format(oozieUser, falconUser)
+    print "Setting new  oozie admin user to " + newAdminUsers
+    services["forced-configurations"].append({"type" : "oozie-env", "name" : "oozie_admin_users"})
+    putOozieEnvProperty("oozie_admin_users", newAdminUsers)
 
 
   def createComponentLayoutRecommendations(self, services, hosts):


Mime
View raw message