Fixes and cleans up build/cache directory usage
[apex.git] / build / osc_auth_fix.diff
1 From fc370104156810cb4f65a3235d6bf6ab65f028bd Mon Sep 17 00:00:00 2001
2 From: Boris Bobrov <bbobrov@mirantis.com>
3 Date: Thu, 17 Nov 2016 13:46:21 +0300
4 Subject: [PATCH] Use project_domain_id only in password auth
5
6 The method being changed constructs domain-related parameters that will
7 further be passed to the auth plugin. If project domain is not
8 passed, the method sets it to the default domain.
9
10 token_endpoint does not expect any information about domain,
11 because it uses only a token and URL. Passing it to auth plugin causes
12 an exception.
13
14 Construct domain-related parameters only for specific plugins, such
15 as password or totp.
16
17 Change-Id: I13db3bbe31a0ed843e9f4528d37c768546e2bee9
18 Closes-Bug: 1642301
19 (cherry picked from commit e51a8d63747932f2ee4ffab02dfb0cd43e4a103d)
20 ---
21
22 diff --git a/openstackclient/common/client_config.py b/openstackclient/common/client_config.py
23 index 895909e..e23b07b 100644
24 --- a/openstackclient/common/client_config.py
25 +++ b/openstackclient/common/client_config.py
26 @@ -148,6 +148,7 @@
27              # present, then do not change the behaviour. Otherwise, set the
28              # PROJECT_DOMAIN_ID to 'OS_DEFAULT_DOMAIN' for better usability.
29              if (
30 +                    auth_type in ("password", "v3password", "v3totp") and
31                      not config['auth'].get('project_domain_id') and
32                      not config['auth'].get('project_domain_name')
33              ):