code: def add_user_to_group(username, group):
      
      cmd = ['gpasswd', '-a', username, group]
      log("Adding user {} to group {}".format(username, group))
      subprocess.check_call(cmd)
docs: Add a user to a group