Browse Source

AMBARI-2520. Setting up encryption after chaning ambari user account fails. (swagle)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1497966 13f79535-47bb-0310-9956-ffa450edef68
Siddharth Wagle 12 năm trước cách đây
mục cha
commit
dda50cba78
1 tập tin đã thay đổi với 12 bổ sung1 xóa
  1. 12 1
      ambari-server/src/main/python/ambari-server.py

+ 12 - 1
ambari-server/src/main/python/ambari-server.py

@@ -2472,6 +2472,12 @@ def setup_master_key(resetKey=False):
       if retCode != 0:
         print 'Saving secure ldap password failed. Exiting.'
 
+  # Since files for store and master are created we need to ensure correct
+  # permissions
+  ambari_user = read_ambari_user()
+  if ambari_user:
+    adjust_directory_permissions(ambari_user)
+
   return key, True, persist
 
 def get_credential_store_location(properties):
@@ -2674,13 +2680,18 @@ def setup_https(args):
       f = open(conf_file, 'w')
       properties.store(f, "Changed by 'ambari-server setup-https' command")
       if is_server_runing():
-        print 'NOTE: Reset Ambari Server to apply changes'+\
+        print 'NOTE: Restart Ambari Server to apply changes'+\
               ' ("ambari-server restart|stop|start")'
     except (KeyError), e:
       err = 'Property ' + str(e) + ' is not defined at ' + conf_file
       raise FatalException(1, err)
   else:
     print "setup-https is not enabled in silent mode."
+
+  ambari_user = read_ambari_user()
+  if ambari_user:
+    adjust_directory_permissions(ambari_user)
+
   print "Ambari Server 'HTTPS setup' completed successfully. Exiting."
   
 def is_server_runing():