From d2920dfc3cf7473bfcc38675c76282d44ca910d7 Mon Sep 17 00:00:00 2001 From: Evan Slaughter Date: Fri, 6 Sep 2019 16:51:38 -0500 Subject: [PATCH] Fixed the set_perms chown operation that was not recursively setting permissions --- entrypoint.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/entrypoint.py b/entrypoint.py index fc767ba..22b0cbc 100755 --- a/entrypoint.py +++ b/entrypoint.py @@ -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(