Check that role file exists

main
Bob Mottram 2021-03-08 21:19:37 +00:00
parent d463e62ee5
commit 206a56414a
1 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,8 @@ def setRole(baseDir: str, nickname: str, domain: str,
else:
# remove the role
if project == 'instance':
_removeRole(baseDir, nickname, roleFiles[role])
if roleFiles.get(role):
_removeRole(baseDir, nickname, roleFiles[role])
if actorJson['roles'].get(project):
actorJson['roles'][project].remove(role)
# if the project contains no roles then remove it