Skip to content

Commit

Permalink
Use KeyError exception when labels is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Lujeni committed Sep 11, 2019
1 parent 5d24416 commit d32b30e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gitlab2rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def delete_deprecated_user_role_bindings(self, users):
user_id = role_binding.metadata.labels[
"gitlab2rbac.kubernetes.io/user_id"
]
except (TypeError, ValueError):
except (TypeError, KeyError):
continue

if user_id not in users_ids:
Expand Down

0 comments on commit d32b30e

Please sign in to comment.