keystoneauth/keystoneauth1/loading/_plugins/admin_token.py
Monty Taylor 67280cbb01 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
2015-10-11 10:25:35 -04:00

36 lines
1.2 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from keystoneauth1 import loading
from keystoneauth1 import token_endpoint
class AdminToken(loading.BaseLoader):
@property
def plugin_class(self):
return token_endpoint.Token
def get_options(self):
options = super(AdminToken, self).get_options()
options.extend([
loading.Opt('endpoint',
deprecated=[loading.Opt('url')],
help='The endpoint that will always be used'),
loading.Opt('token',
secret=True,
help='The token that will always be used'),
])
return options