Merge "Add url as a deprecated alias for endpoint"

This commit is contained in:
Jenkins 2015-10-16 01:58:54 +00:00 committed by Gerrit Code Review
commit cdef92c7a1
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)