|
16 | 16 | import logging |
17 | 17 |
|
18 | 18 | from keystoneauth1 import loading |
19 | | -from keystoneauth1.loading._plugins.identity import generic as ksa_password |
20 | 19 | from keystoneauth1 import token_endpoint |
21 | | -from six.moves.urllib import parse as urlparse |
22 | 20 |
|
23 | 21 | from openstackclient.i18n import _ |
24 | 22 |
|
@@ -65,45 +63,3 @@ def get_options(self): |
65 | 63 | ), |
66 | 64 | ] |
67 | 65 | return options |
68 | | - |
69 | | - |
70 | | -class OSCGenericPassword(ksa_password.Password): |
71 | | - """Auth plugin hack to work around broken Keystone configurations |
72 | | -
|
73 | | - The default Keystone configuration uses http://localhost:xxxx in |
74 | | - admin_endpoint and public_endpoint and are returned in the links.href |
75 | | - attribute by the version routes. Deployments that do not set these |
76 | | - are unusable with newer keystoneclient version discovery. |
77 | | -
|
78 | | - """ |
79 | | - |
80 | | - def create_plugin(self, session, version, url, raw_status=None): |
81 | | - """Handle default Keystone endpoint configuration |
82 | | -
|
83 | | - Build the actual API endpoint from the scheme, host and port of the |
84 | | - original auth URL and the rest from the returned version URL. |
85 | | - """ |
86 | | - |
87 | | - ver_u = urlparse.urlparse(url) |
88 | | - |
89 | | - # Only hack this if it is the default setting |
90 | | - if ver_u.netloc.startswith('localhost'): |
91 | | - auth_u = urlparse.urlparse(self.auth_url) |
92 | | - # from original auth_url: scheme, netloc |
93 | | - # from api_url: path, query (basically, the rest) |
94 | | - url = urlparse.urlunparse(( |
95 | | - auth_u.scheme, |
96 | | - auth_u.netloc, |
97 | | - ver_u.path, |
98 | | - ver_u.params, |
99 | | - ver_u.query, |
100 | | - ver_u.fragment, |
101 | | - )) |
102 | | - LOG.debug('Version URL updated: %s', url) |
103 | | - |
104 | | - return super(OSCGenericPassword, self).create_plugin( |
105 | | - session=session, |
106 | | - version=version, |
107 | | - url=url, |
108 | | - raw_status=raw_status, |
109 | | - ) |
0 commit comments