diff --git a/keystoneclient/auth/token_endpoint.py b/keystoneclient/auth/token_endpoint.py index 1f031d229..1a04b9d75 100644 --- a/keystoneclient/auth/token_endpoint.py +++ b/keystoneclient/auth/token_endpoint.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo.config import cfg from keystoneclient.auth import base @@ -38,8 +39,9 @@ class Token(base.BaseAuthPlugin): """ return self.endpoint - def get_options(self): - options = super(Token, self).get_options() + @classmethod + def get_options(cls): + options = super(Token, cls).get_options() options.extend([ cfg.StrOpt('endpoint', diff --git a/keystoneclient/tests/auth/test_token_endpoint.py b/keystoneclient/tests/auth/test_token_endpoint.py index 1f2c01d6a..a9028e374 100644 --- a/keystoneclient/tests/auth/test_token_endpoint.py +++ b/keystoneclient/tests/auth/test_token_endpoint.py @@ -10,6 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. +from testtools import matchers + from keystoneclient.auth import token_endpoint from keystoneclient import session from keystoneclient.tests import utils @@ -43,3 +45,11 @@ class TokenEndpointTest(utils.TestCase): self.assertEqual(self.TEST_URL, a.get_endpoint(s)) self.assertEqual('body', data.text) self.assertRequestHeaderEqual('X-Auth-Token', self.TEST_TOKEN) + + def test_token_endpoint_options(self): + opt_names = [opt.name for opt in token_endpoint.Token.get_options()] + + self.assertThat(opt_names, matchers.HasLength(2)) + + self.assertIn('token', opt_names) + self.assertIn('endpoint', opt_names)