hooks/post_gen_project.py
changeset 8 8ab3fffe8d36
parent 6 365da6d54a09
child 15 c3dbfc6488c2
--- a/hooks/post_gen_project.py	Fri Oct 06 09:21:29 2017 +0200
+++ b/hooks/post_gen_project.py	Fri Oct 06 09:39:50 2017 +0200
@@ -44,7 +44,10 @@
     except PermissionError:
         print("WARNING: Can't create logs directory {0}".format(LOGS_DIRECTORY))
     else:
-        os.chown(LOGS_DIRECTORY, user_id, group_id)
+        try:
+            os.chown(LOGS_DIRECTORY, user_id, group_id)
+        except PermissionError:
+            print("WARNING: Can't set owner ({0}:{1}) for directory {2}".format(user_id, group_id, LOGS_DIRECTORY))
 
 
 #