Skip to content

Commit 3ba44d2

Browse files
committed
Set default permission mode via stat values
1 parent 7ca89a1 commit 3ba44d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/minecraft_server_file.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def __init__(self, module):
5959
self.path = os.path.expanduser(module.params['path'])
6060
self.owner = module.params['owner']
6161
self.group = module.params['group']
62-
self.mode = module.params['mode'] if module.params['mode'] else 0644
62+
# Python version agnostic way of setting permissions 0644
63+
perm_0644 = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
64+
self.mode = module.params['mode'] if module.params['mode'] else perm_0644
6365

6466
@property
6567
def changed(self):

0 commit comments

Comments
 (0)