Fix "is" usage with literals
This throws warnings on Python 3.8.
Change-Id: I82625d6d202b33daaa2e7f02fbfb8dc5ab59079c
Eric Harney
3 years ago
143 | 143 | return self._barbican_client |
144 | 144 | |
145 | 145 | def _get_keystone_auth(self, context): |
146 | if context.__class__.__name__ is 'KeystonePassword': | |
146 | if context.__class__.__name__ == 'KeystonePassword': | |
147 | 147 | return identity.Password( |
148 | 148 | auth_url=context.auth_url, |
149 | 149 | username=context.username, |
159 | 159 | project_domain_id=context.project_domain_id, |
160 | 160 | project_domain_name=context.project_domain_name, |
161 | 161 | reauthenticate=context.reauthenticate) |
162 | elif context.__class__.__name__ is 'KeystoneToken': | |
162 | elif context.__class__.__name__ == 'KeystoneToken': | |
163 | 163 | return identity.Token( |
164 | 164 | auth_url=context.auth_url, |
165 | 165 | token=context.token, |
173 | 173 | reauthenticate=context.reauthenticate) |
174 | 174 | # this will be kept for oslo.context compatibility until |
175 | 175 | # projects begin to use utils.credential_factory |
176 | elif context.__class__.__name__ is 'RequestContext': | |
176 | elif context.__class__.__name__ == 'RequestContext': | |
177 | 177 | if getattr(context, 'get_auth_plugin', None): |
178 | 178 | return context.get_auth_plugin() |
179 | 179 | else: |