mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Added support of returning owner's group name in stat module
This commit is contained in:
parent
90091b1277
commit
59477d2e9a
1 changed files with 4 additions and 0 deletions
|
@ -66,6 +66,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
from stat import *
|
from stat import *
|
||||||
import pwd
|
import pwd
|
||||||
|
import grp
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
|
@ -141,6 +142,9 @@ def main():
|
||||||
pw = pwd.getpwuid(st.st_uid)
|
pw = pwd.getpwuid(st.st_uid)
|
||||||
|
|
||||||
d['pw_name'] = pw.pw_name
|
d['pw_name'] = pw.pw_name
|
||||||
|
|
||||||
|
grp_info = grp.getgrgid(pw.pw_gid)
|
||||||
|
d['gr_name'] = grp_info.gr_name
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue