Repository: ambari Updated Branches: refs/heads/trunk 8fcf9f115 -> 302370d94
AMBARI-11666 :[WinTP2] ambari-server setup without arguments doesn't customize the service account password Fixed user account setup logic Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/302370d9 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/302370d9 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/302370d9 Branch: refs/heads/trunk Commit: 302370d94f7b65ca7d278edb4fd181e8b66c32d5 Parents: 8fcf9f1 Author: Florian Barca <fba...@hortonworks.com> Authored: Wed Jun 3 15:22:43 2015 -0700 Committer: Florian Barca <fba...@hortonworks.com> Committed: Wed Jun 3 15:22:43 2015 -0700 ---------------------------------------------------------------------- .../src/main/python/ambari_server/serverSetup.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/302370d9/ambari-server/src/main/python/ambari_server/serverSetup.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py index 4bd6903..ede1cf3 100644 --- a/ambari-server/src/main/python/ambari_server/serverSetup.py +++ b/ambari-server/src/main/python/ambari_server/serverSetup.py @@ -225,16 +225,19 @@ class AmbariUserChecksWindows(AmbariUserChecks): self.user = user return 0 + if get_silent(): + password = self.password + else: + password = get_validated_string_input("Enter password for user {0}:".format(user), "", None, "Password", True, False) + from ambari_commons.os_windows import UserHelper uh = UserHelper(user) - if not uh.find_user(): - if get_silent(): - password = self.password - else: - password = get_validated_string_input("Enter password for user {0}:".format(user), "", None, "Password", True, False) - + if uh.find_user(): + print_info_msg("User {0} already exists, make sure that you typed correct password for user, " + "skipping user creation".format(user)) + else: status, message = uh.create_user(password) if status == UserHelper.USER_EXISTS: print_info_msg("User {0} already exists, make sure that you typed correct password for user, " @@ -244,7 +247,7 @@ class AmbariUserChecksWindows(AmbariUserChecks): print_warning_msg("Can't create user {0}. Failed with message {1}".format(user, message)) return UserHelper.ACTION_FAILED - self.password = password + self.password = password # setting SeServiceLogonRight and SeBatchLogonRight to user #This is unconditional