From fda03d76d983c2b1dcd3b5b1f71ae3986763069d Mon Sep 17 00:00:00 2001 From: hydromelvictor Date: Sun, 11 Feb 2024 16:40:40 +0000 Subject: [PATCH] update --- lib/ansible/modules/user.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/user.py b/lib/ansible/modules/user.py index 260189b47ca..e896581dd11 100644 --- a/lib/ansible/modules/user.py +++ b/lib/ansible/modules/user.py @@ -917,11 +917,9 @@ class User(object): if self.move_home: cmd.append('-m') - if self.shell is not None: - expanded_shell = os.path.expanduser(self.shell) - if info[6] != expanded_shell: - cmd.append('-s') - cmd.append(expanded_shell) + if self.shell is not None and info[6] != self.shell: + cmd.append('-s') + cmd.append(self.shell) if self.expires is not None: