Remove SERVICE_TOKEN and SERVICE_ENDPOINT env vars
From the code itself: deprecated command line options for essex compatibility. To be removed in Grizzly release cycle. so this patch removes these deprecated env vars that have been moved into the OS_* namespace since Folsom, and updates the tests that probably should have been using the non-deprecated option anyway :) The fact these are still in there are causing some confusion, we actually had a bug report over in docs claiming OS_SERVICE_TOKEN should be replaced with SERVICE_TOKEN! Change-Id: I205748be225dbacc3a528724cf3722d8bf7f8d9f
This commit is contained in:
		@@ -243,20 +243,6 @@ class OpenStackIdentityShell(object):
 | 
			
		||||
                                 "network delays. Default is %s seconds." % (
 | 
			
		||||
                            access.STALE_TOKEN_DURATION))
 | 
			
		||||
 | 
			
		||||
        #FIXME(heckj):
 | 
			
		||||
        # deprecated command line options for essex compatibility. To be
 | 
			
		||||
        # removed in Grizzly release cycle.
 | 
			
		||||
        parser.add_argument('--token',
 | 
			
		||||
                            metavar='<service-token>',
 | 
			
		||||
                            dest='os_token',
 | 
			
		||||
                            default=env('SERVICE_TOKEN'),
 | 
			
		||||
                            help=argparse.SUPPRESS)
 | 
			
		||||
        parser.add_argument('--endpoint',
 | 
			
		||||
                            dest='os_endpoint',
 | 
			
		||||
                            metavar='<service-endpoint>',
 | 
			
		||||
                            default=env('SERVICE_ENDPOINT'),
 | 
			
		||||
                            help=argparse.SUPPRESS)
 | 
			
		||||
 | 
			
		||||
        return parser
 | 
			
		||||
 | 
			
		||||
    def get_subcommand_parser(self, version):
 | 
			
		||||
 
 | 
			
		||||
@@ -132,12 +132,12 @@ class ShellTest(utils.TestCase):
 | 
			
		||||
    def test_token_no_endpoint(self):
 | 
			
		||||
        with testtools.ExpectedException(
 | 
			
		||||
                exceptions.CommandError, 'Expecting an endpoint provided'):
 | 
			
		||||
            self.shell('--token=%s user-list' % uuid.uuid4().hex)
 | 
			
		||||
            self.shell('--os-token=%s user-list' % uuid.uuid4().hex)
 | 
			
		||||
 | 
			
		||||
    def test_endpoint_no_token(self):
 | 
			
		||||
        with testtools.ExpectedException(
 | 
			
		||||
                exceptions.CommandError, 'Expecting a token provided'):
 | 
			
		||||
            self.shell('--endpoint=http://10.0.0.1:5000/v2.0/ user-list')
 | 
			
		||||
            self.shell('--os-endpoint=http://10.0.0.1:5000/v2.0/ user-list')
 | 
			
		||||
 | 
			
		||||
    def test_shell_args(self):
 | 
			
		||||
        do_tenant_mock = mock.MagicMock()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user