Updated Branches:
  refs/heads/trunk 6e28d760f -> 82a104ee6

AMBARI-2644. Ambari-server can not find password for remote database with 
password encryption enabled. (swagle)


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

Branch: refs/heads/trunk
Commit: ca76062c2a6d75500bdf7caf59f7759d12b44097
Parents: 6e28d76
Author: Siddharth Wagle <[email protected]>
Authored: Fri Jul 12 13:04:22 2013 -0700
Committer: Siddharth Wagle <[email protected]>
Committed: Fri Jul 12 13:04:22 2013 -0700

----------------------------------------------------------------------
 ambari-server/src/main/python/ambari-server.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/ca76062c/ambari-server/src/main/python/ambari-server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 5ffbcf7..5e03a62 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -2758,25 +2758,29 @@ def setup_master_key():
   # Encrypt only un-encrypted passwords
   if db_password and not is_alias_string(db_password):
     retCode = save_passwd_for_alias(JDBC_RCA_PASSWORD_ALIAS, db_password, 
masterKey)
-    propertyMap[JDBC_PASSWORD_PROPERTY] = 
get_alias_string(JDBC_RCA_PASSWORD_ALIAS)
     if retCode != 0:
       print 'Failed to save secure database password.'
     else:
+      propertyMap[JDBC_PASSWORD_PROPERTY] = 
get_alias_string(JDBC_RCA_PASSWORD_ALIAS)
       remove_password_file(JDBC_PASSWORD_FILENAME)
+      if properties.get_property(JDBC_RCA_PASSWORD_FILE_PROPERTY):
+        propertyMap[JDBC_RCA_PASSWORD_FILE_PROPERTY] = 
get_alias_string(JDBC_RCA_PASSWORD_ALIAS)
   pass
 
   if ldap_password and not is_alias_string(ldap_password):
     retCode = save_passwd_for_alias(LDAP_MGR_PASSWORD_ALIAS, ldap_password, 
masterKey)
-    propertyMap[LDAP_MGR_PASSWORD_PROPERTY] = 
get_alias_string(LDAP_MGR_PASSWORD_ALIAS)
     if retCode != 0:
       print 'Failed to save secure LDAP password.'
+    else:
+      propertyMap[LDAP_MGR_PASSWORD_PROPERTY] = 
get_alias_string(LDAP_MGR_PASSWORD_ALIAS)
   pass
 
   if ts_password and not is_alias_string(ts_password):
     retCode = save_passwd_for_alias(SSL_TRUSTSTORE_PASSWORD_ALIAS, 
ts_password, masterKey)
-    propertyMap[SSL_TRUSTSTORE_PASSWORD_PROPERTY] = 
get_alias_string(SSL_TRUSTSTORE_PASSWORD_ALIAS)
     if retCode != 0:
       print 'Failed to save secure TrustStore password.'
+    else:
+      propertyMap[SSL_TRUSTSTORE_PASSWORD_PROPERTY] = 
get_alias_string(SSL_TRUSTSTORE_PASSWORD_ALIAS)
   pass
 
   update_properties(properties, propertyMap)

Reply via email to