saltstack/salt — pull request #12075 by mtorromeo (2014-04-17 14:49:15+00:00)
Title: Fix adding tenant to keystone user with no previous tenant assigned

Applying a keystone.user_present state on a user without a tenant currently raises the following exception:

Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/state.py", line 1371, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/site-packages/salt/states/keystone.py", line 141, in user_present
if tenant and user[name]['tenant_id'] != tenant_id:
KeyError: 'tenant_id'

This commit applies the required key check.