hooks/post_gen_project.py
changeset 8 8ab3fffe8d36
parent 6 365da6d54a09
child 15 c3dbfc6488c2
equal deleted inserted replaced
7:17dcd938afa3 8:8ab3fffe8d36
    42     try:
    42     try:
    43         os.makedirs(LOGS_DIRECTORY, mode=0o775, exist_ok=True)
    43         os.makedirs(LOGS_DIRECTORY, mode=0o775, exist_ok=True)
    44     except PermissionError:
    44     except PermissionError:
    45         print("WARNING: Can't create logs directory {0}".format(LOGS_DIRECTORY))
    45         print("WARNING: Can't create logs directory {0}".format(LOGS_DIRECTORY))
    46     else:
    46     else:
    47         os.chown(LOGS_DIRECTORY, user_id, group_id)
    47         try:
       
    48             os.chown(LOGS_DIRECTORY, user_id, group_id)
       
    49         except PermissionError:
       
    50             print("WARNING: Can't set owner ({0}:{1}) for directory {2}".format(user_id, group_id, LOGS_DIRECTORY))
    48 
    51 
    49 
    52 
    50 #
    53 #
    51 # Check for var directory
    54 # Check for var directory
    52 #
    55 #