You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2014/09/22 20:48:43 UTC

git commit: AMBARI-7437. Admin : Get credentials for ambari-server sync-ldap.

Repository: ambari
Updated Branches:
  refs/heads/trunk 58611d8f6 -> 2ef524fd6


AMBARI-7437. Admin : Get credentials for ambari-server sync-ldap.


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

Branch: refs/heads/trunk
Commit: 2ef524fd69ee5cf686177704d049022f8a30c1b9
Parents: 58611d8
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Mon Sep 22 11:24:05 2014 -0700
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Mon Sep 22 11:47:35 2014 -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/ambari/blob/2ef524fd/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 c7d6150..a99ad05 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -127,8 +127,6 @@ SERVER_API_HOST = '127.0.0.1'
 SERVER_API_PROTOCOL = 'http'
 SERVER_API_PORT = '8080'
 SERVER_API_LDAP_URL = '/api/v1/controllers/ldap'
-SERVER_API_LOGIN = 'admin'
-SERVER_API_PASS = 'admin'
 
 # terminal styles
 BOLD_ON = '\033[1m'
@@ -3048,8 +3046,14 @@ def sync_ldap():
     err = "LDAP is not configured. Run 'ambari-server setup-ldap' first."
     raise FatalException(1, err)
 
+  admin_login = get_validated_string_input(prompt="Enter login: ", default=None,
+                                           pattern=None, description=None,
+                                           is_pass=False, allowEmpty=False)
+  admin_password = get_validated_string_input(prompt="Enter password: ", default=None,
+                                              pattern=None, description=None,
+                                              is_pass=True, allowEmpty=False)
   url = '{0}://{1}:{2!s}{3}'.format(SERVER_API_PROTOCOL, SERVER_API_HOST, SERVER_API_PORT, SERVER_API_LDAP_URL)
-  admin_auth = base64.encodestring('%s:%s' % (SERVER_API_LOGIN, SERVER_API_PASS)).replace('\n', '')
+  admin_auth = base64.encodestring('%s:%s' % (admin_login, admin_password)).replace('\n', '')
   request = urllib2.Request(url)
   request.add_header('Authorization', 'Basic %s' % admin_auth)
   request.add_header('X-Requested-By', 'ambari')