Add url as a deprecated alias for endpoint

In order for us to transition python-openstackclient to keystoneauth,
we need a path forward so that people can move from using the in-tree
token-endpoint plugin to just using the admin-token plugin (which is the
thing that should be used for the bootstrapping-keystone usecase)

We could do fancy things in OCC to accomplish this (I have a patch) -
but instead of doing that, which is, as Dean says, really a layer
violation, why don't we just put url in here and be done with it.

Change-Id: Ia240d9599aad0c3e6727fcde451e3ddd21bc242f
This commit is contained in:
Monty Taylor 2015-09-19 16:38:57 -04:00
parent 4501513ff3
commit 67280cbb01
2 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class AdminToken(loading.BaseLoader):
options.extend([
loading.Opt('endpoint',
deprecated=[loading.Opt('url')],
help='The endpoint that will always be used'),
loading.Opt('token',
secret=True,

View File

@ -65,3 +65,12 @@ class AdminTokenTest(utils.TestCase):
self.assertIn('token', opt_names)
self.assertIn('endpoint', opt_names)
def test_token_endpoint_deprecated_options(self):
endpoint_opt = [
opt for opt in loader.AdminToken().get_options()
if opt.name == 'endpoint'][0]
opt_names = [opt.name for opt in endpoint_opt.deprecated]
self.assertEqual(['url'], opt_names)