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
parent 786613f426
commit 0ca61e9d87
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')