mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix group mod and group add for FreeBSD
This commit is contained in:
committed by
Matt Clay
parent
29620b78fa
commit
4c8b573e2c
@@ -233,7 +233,8 @@ class FreeBsdGroup(Group):
|
|||||||
def group_add(self, **kwargs):
|
def group_add(self, **kwargs):
|
||||||
cmd = [self.module.get_bin_path('pw', True), 'groupadd', self.name]
|
cmd = [self.module.get_bin_path('pw', True), 'groupadd', self.name]
|
||||||
if self.gid is not None:
|
if self.gid is not None:
|
||||||
cmd.append('-g %d' % int(self.gid))
|
cmd.append('-g')
|
||||||
|
cmd.append('%d' % int(self.gid))
|
||||||
return self.execute_command(cmd)
|
return self.execute_command(cmd)
|
||||||
|
|
||||||
def group_mod(self, **kwargs):
|
def group_mod(self, **kwargs):
|
||||||
@@ -241,7 +242,8 @@ class FreeBsdGroup(Group):
|
|||||||
info = self.group_info()
|
info = self.group_info()
|
||||||
cmd_len = len(cmd)
|
cmd_len = len(cmd)
|
||||||
if self.gid is not None and int(self.gid) != info[2]:
|
if self.gid is not None and int(self.gid) != info[2]:
|
||||||
cmd.append('-g %d' % int(self.gid))
|
cmd.append('-g')
|
||||||
|
cmd.append('%d' % int(self.gid))
|
||||||
# modify the group if cmd will do anything
|
# modify the group if cmd will do anything
|
||||||
if cmd_len != len(cmd):
|
if cmd_len != len(cmd):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
|
|||||||
Reference in New Issue
Block a user