Only report change when home directory is different on FreeBSD (#42865)

* Only report change when home directory is different

Add tests with home: parameter

Have to skip macOS for now since there is a bug when specifying the home directory path for an existing user that results in a module failure. That needs to be fixed in a separate PR.
This commit is contained in:
Sam Doran 2018-07-19 10:07:00 -04:00 committed by GitHub
commit 0ca61e9d87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 5 deletions

View file

@ -1010,8 +1010,9 @@ class FreeBsdUser(User):
if self.home is not None:
if (info[5] != self.home and self.move_home) or (not os.path.exists(self.home) and self.create_home):
cmd.append('-m')
cmd.append('-d')
cmd.append(self.home)
if info[5] != self.home:
cmd.append('-d')
cmd.append(self.home)
if self.skeleton is not None:
cmd.append('-k')