Added opportunity to set extra user options.
Change-Id: I191eca8806f92c84896e776ddc8b9263f00947ae
Related-PROD: PROD-28027
diff --git a/_states/keystonev3.py b/_states/keystonev3.py
index a9a2ccd..6962290 100644
--- a/_states/keystonev3.py
+++ b/_states/keystonev3.py
@@ -256,15 +256,23 @@
exact_user = users[0]
user_id = exact_user['id']
changable = (
- 'default_project_id', 'domain_id', 'enabled', 'email'
+ 'default_project_id', 'domain_id', 'enabled', 'email', 'options'
)
if password_reset:
changable += ('password',)
to_update = {}
for key in kwargs:
- if (key in changable and (key not in exact_user or
- kwargs[key] != exact_user[key])):
+ if key in changable:
+ if key == 'options':
+ to_update['options'] = {option: value for option, value in kwargs['options'].items()
+ if (option not in exact_user['options'])
+ or (value != exact_user['options'][option])}
+
+ if not len(to_update['options']):
+ del to_update['options']
+
+ elif key not in exact_user or kwargs[key] != exact_user[key]:
to_update[key] = kwargs[key]
if to_update: