Fixed the set_perms chown operation that was not recursively setting permissions

This commit is contained in:
Evan Slaughter 2019-09-06 16:51:38 -05:00
parent bcaf05a3ab
commit d2920dfc3c

View File

@ -13,8 +13,12 @@ import jinja2 as j2
logging.basicConfig(level=logging.DEBUG)
def set_perms(path, user, group, mode):
shutil.chown(path, user=user, group=group)
os.chmod(path, mode)
for dirpath, dirnames, filenames in os.walk(path):
shutil.chown(dirpath, user=user, group=group)
os.chmod(dirpath, mode)
for filename in filenames:
shutil.chown(os.path.join(dirpath, filename), user=user, group=group)
os.chmod(os.path.join(dirpath, filename), mode)
# Setup Jinja2 for templating
jenv = j2.Environment(