Merge "Warning for empty password set for user create/set"
This commit is contained in:
		@@ -94,6 +94,10 @@ class CreateUser(command.ShowOne):
 | 
				
			|||||||
        if parsed_args.password_prompt:
 | 
					        if parsed_args.password_prompt:
 | 
				
			||||||
            parsed_args.password = utils.get_password(self.app.stdin)
 | 
					            parsed_args.password = utils.get_password(self.app.stdin)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if not parsed_args.password:
 | 
				
			||||||
 | 
					            LOG.warning(_("No password was supplied, authentication will fail "
 | 
				
			||||||
 | 
					                          "when a user does not have a password."))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            user = identity_client.users.create(
 | 
					            user = identity_client.users.create(
 | 
				
			||||||
                parsed_args.name,
 | 
					                parsed_args.name,
 | 
				
			||||||
@@ -292,6 +296,10 @@ class SetUser(command.Command):
 | 
				
			|||||||
        if parsed_args.password_prompt:
 | 
					        if parsed_args.password_prompt:
 | 
				
			||||||
            parsed_args.password = utils.get_password(self.app.stdin)
 | 
					            parsed_args.password = utils.get_password(self.app.stdin)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if '' == parsed_args.password:
 | 
				
			||||||
 | 
					            LOG.warning(_("No password was supplied, authentication will fail "
 | 
				
			||||||
 | 
					                          "when a user does not have a password."))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        user = utils.find_resource(
 | 
					        user = utils.find_resource(
 | 
				
			||||||
            identity_client.users,
 | 
					            identity_client.users,
 | 
				
			||||||
            parsed_args.user,
 | 
					            parsed_args.user,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -110,6 +110,10 @@ class CreateUser(command.ShowOne):
 | 
				
			|||||||
        if parsed_args.password_prompt:
 | 
					        if parsed_args.password_prompt:
 | 
				
			||||||
            parsed_args.password = utils.get_password(self.app.stdin)
 | 
					            parsed_args.password = utils.get_password(self.app.stdin)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if not parsed_args.password:
 | 
				
			||||||
 | 
					            LOG.warning(_("No password was supplied, authentication will fail "
 | 
				
			||||||
 | 
					                          "when a user does not have a password."))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            user = identity_client.users.create(
 | 
					            user = identity_client.users.create(
 | 
				
			||||||
                name=parsed_args.name,
 | 
					                name=parsed_args.name,
 | 
				
			||||||
@@ -329,6 +333,10 @@ class SetUser(command.Command):
 | 
				
			|||||||
        if parsed_args.password_prompt:
 | 
					        if parsed_args.password_prompt:
 | 
				
			||||||
            parsed_args.password = utils.get_password(self.app.stdin)
 | 
					            parsed_args.password = utils.get_password(self.app.stdin)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if '' == parsed_args.password:
 | 
				
			||||||
 | 
					            LOG.warning(_("No password was supplied, authentication will fail "
 | 
				
			||||||
 | 
					                          "when a user does not have a password."))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        user = utils.find_resource(
 | 
					        user = utils.find_resource(
 | 
				
			||||||
            identity_client.users,
 | 
					            identity_client.users,
 | 
				
			||||||
            parsed_args.user,
 | 
					            parsed_args.user,
 | 
				
			||||||
@@ -408,6 +416,10 @@ class SetPasswordUser(command.Command):
 | 
				
			|||||||
            password = utils.get_password(
 | 
					            password = utils.get_password(
 | 
				
			||||||
                self.app.stdin, prompt="New Password:")
 | 
					                self.app.stdin, prompt="New Password:")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if '' == password:
 | 
				
			||||||
 | 
					            LOG.warning(_("No password was supplied, authentication will fail "
 | 
				
			||||||
 | 
					                          "when a user does not have a password."))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        identity_client.users.update_password(current_password, password)
 | 
					        identity_client.users.update_password(current_password, password)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								releasenotes/notes/bug-1607959-a52aa93e3793f28a.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								releasenotes/notes/bug-1607959-a52aa93e3793f28a.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					fixes:
 | 
				
			||||||
 | 
					  - |
 | 
				
			||||||
 | 
					    A warning message will be shown when an empty password is used
 | 
				
			||||||
 | 
					    for ``user create`` and ``user set`` operations.
 | 
				
			||||||
 | 
					    [Bug `1607959 <https://bugs.launchpad.net/bugs/1607959>`_]
 | 
				
			||||||
		Reference in New Issue
	
	Block a user