From 3152af78b5d702fe4b95e7eb31715bc3af5dbea4 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Mon, 21 Sep 2015 15:48:07 +0200 Subject: [PATCH] Fix the crash on token auth via API (http://git.io/vn4tx) --- salt/master.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/salt/master.py b/salt/master.py index c2aba4446d..917290e354 100644 --- a/salt/master.py +++ b/salt/master.py @@ -1779,10 +1779,11 @@ class ClearFuncs(object): # If there are groups in the token, check if any of them are listed in the eauth config group_auth_match = False try: - for group in token['groups']: - if group in eauth_groups: - group_auth_match = True - break + if token.get('groups') in [False, None]: + for group in token['groups']: + if group in eauth_groups: + group_auth_match = True + break except KeyError: pass if '*' not in eauth_users and token['name'] not in eauth_users and not group_auth_match: