Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. [knikolla@lenovo-moc1 k2k-openstackclient]$ git diff master..k2k
  2. diff --git a/openstackclient/common/clientmanager.py b/openstackclient/common/clientmanager.py
  3. index 56ddcba..0295116 100644
  4. --- a/openstackclient/common/clientmanager.py
  5. +++ b/openstackclient/common/clientmanager.py
  6. @@ -205,6 +205,31 @@ class ClientManager(object):
  7. if not self._auth_ref:
  8. self.setup_auth()
  9. LOG.debug("Get auth_ref")
  10. +
  11. + if self._cli_options.os_service_provider:
  12. + from keystoneauth1 import identity
  13. + from keystoneauth1 import session as ks
  14. + from keystoneauth1.identity.v3.k2k import Keystone2Keystone
  15. +
  16. + idp_auth = identity.Password(auth_url=self._auth_params['auth_url'],
  17. + username=self._auth_params['username'],
  18. + password=self._auth_params['password'],
  19. + project_name=self._auth_params[
  20. + 'project_name'],
  21. + project_domain_id=self._auth_params[
  22. + 'project_domain_id'],
  23. + user_domain_id=self._auth_params[
  24. + 'user_domain_id'])
  25. +
  26. + self.auth = Keystone2Keystone(idp_auth,
  27. + self._cli_options.os_service_provider,
  28. + project_name=self._auth_params[
  29. + 'project_name'],
  30. + project_domain_id=self._auth_params[
  31. + 'project_domain_id'])
  32. +
  33. + self.session = ks.Session(auth=self.auth)
  34. +
  35. self._auth_ref = self.auth.get_auth_ref(self.session)
  36. return self._auth_ref
  37.  
  38. @@ -239,7 +264,7 @@ class ClientManager(object):
  39. endpoint = self.auth_ref.service_catalog.url_for(
  40. service_type=service_type,
  41. region_name=region_name,
  42. - endpoint_type=interface,
  43. + #endpoint_type=interface,
  44. )
  45. else:
  46. # Get the passed endpoint directly from the auth plugin
  47. diff --git a/openstackclient/shell.py b/openstackclient/shell.py
  48. index 7750f2a..9d551d4 100644
  49. --- a/openstackclient/shell.py
  50. +++ b/openstackclient/shell.py
  51. @@ -227,6 +227,13 @@ class OpenStackShell(app.App):
  52. action='store_true',
  53. help="Print API call timing info",
  54. )
  55. + parser.add_argument(
  56. + '--os-service-provider',
  57. + metavar='<os_service_provider>',
  58. + dest='os_service_provider',
  59. + default=None,
  60. + help='Federated Service Provider ID'
  61. + )
  62.  
  63. # osprofiler HMAC key argument
  64. if osprofiler_profiler:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement