1 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2 : Copyright (c) 2019 Mirantis Inc., Enea AB and others.
4 : All rights reserved. This program and the accompanying materials
5 : are made available under the terms of the Apache License, Version 2.0
6 : which accompanies this distribution, and is available at
7 : http://www.apache.org/licenses/LICENSE-2.0
8 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
9 From: Michael Polenchuk <mpolenchuk@mirantis.com>
10 Date: Tue, 22 Jan 2019 12:43:12 +0400
11 Subject: [PATCH] Get domain id instead of name for user_create
13 diff --git a/_states/keystonev3.py b/_states/keystonev3.py
14 index 2dd651d..46aed30 100644
15 --- a/_states/keystonev3.py
16 +++ b/_states/keystonev3.py
17 @@ -237,6 +237,11 @@ def user_present(name, cloud_name, password_reset=False, **kwargs):
18 'project_get_details', kwargs['default_project_id'],
19 cloud_name=cloud_name)['project']['id']
21 + if 'domain_id' in kwargs:
22 + kwargs['domain_id'] = _keystonev3_call(
23 + 'domain_get_details', kwargs['domain_id'],
24 + cloud_name=cloud_name)['domain']['id']
28 resp = _keystonev3_call(