- The secondary user groups are not assigned to the user
- When the json file is on a NFS share where root access is not allowed this script fails with a "error: JobTemplate file (/path/to/jsonfile) doesn't exist" error
To fix the first we have to go through all the groups of the user in set_user(uid) and assign them with os.setgroups()
The second one is fixed by removing the check if the json file exists in the function validate_paramters and move that check to a new function which is called after set_user(uid). Because its possible that the new user (the one in uid) has access to that file but root hasn't