From 206a56414a6bf292bec3e470abc5d1977577d146 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 8 Mar 2021 21:19:37 +0000 Subject: [PATCH] Check that role file exists --- roles.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles.py b/roles.py index 51a43b624..15d381648 100644 --- a/roles.py +++ b/roles.py @@ -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