Use keystoneauth
Keystoneauth was extracted from keystoneclient. This CR replaces usage of keystoneclient in favor of keystoneauth. Co-Authored-By: Clenimar Filemon <clenimar@lsd.ufcg.edu.br> Change-Id: I4262bed1e595d58f31fe80c85e3692e4ca2840fa
This commit is contained in:
committed by
Clenimar Filemon
parent
56e892533c
commit
274b91a723
@@ -26,9 +26,10 @@ from cliff import command
|
||||
from cliff import commandmanager
|
||||
from cliff import complete
|
||||
from cliff import help
|
||||
from keystoneclient.auth.identity import v3
|
||||
from keystoneclient.auth.identity import v2
|
||||
from keystoneclient import session
|
||||
from keystoneauth1.identity import v2
|
||||
from keystoneauth1.identity import v3
|
||||
from keystoneauth1 import loading
|
||||
from keystoneauth1 import session
|
||||
import six
|
||||
|
||||
from barbicanclient import client
|
||||
@@ -318,7 +319,7 @@ class Barbican(app.App):
|
||||
help='Defaults to env[BARBICAN_API_VERSION].')
|
||||
parser.epilog = ('See "barbican help COMMAND" for help '
|
||||
'on a specific command.')
|
||||
session.Session.register_cli_options(parser)
|
||||
loading.register_session_argparse_arguments(parser)
|
||||
return parser
|
||||
|
||||
def prepare_to_run_command(self, cmd):
|
||||
|
||||
@@ -16,8 +16,8 @@ import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
from keystoneclient import adapter
|
||||
from keystoneclient import session as ks_session
|
||||
from keystoneauth1 import adapter
|
||||
from keystoneauth1 import session as ks_session
|
||||
|
||||
from barbicanclient import acls
|
||||
from barbicanclient import cas
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from keystoneclient import session
|
||||
from keystoneauth1 import session
|
||||
import mock
|
||||
from requests_mock.contrib import fixture
|
||||
import testtools
|
||||
|
||||
@@ -5,29 +5,29 @@ Keystone Authentication
|
||||
-----------------------
|
||||
|
||||
The client defers authentication to `Keystone Sessions`_, which provide several
|
||||
authentication plugins in the `keystoneclient.auth` namespace. Below we give
|
||||
authentication plugins in the `keystoneauth1.identity` namespace. Below we give
|
||||
examples of the most commonly used auth plugins.
|
||||
|
||||
.. _`Keystone Sessions`: http://docs.openstack.org/developer/python-keystoneclient/using-sessions.html
|
||||
.. _`Keystone Sessions`: http://docs.openstack.org/developer/keystoneauth/using-sessions.html
|
||||
|
||||
Keystone API Version 3 Authentication
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Authentication using Keystone API Version 3 can be achieved using the
|
||||
`keystoneclient.auth.identity.v3.Password` auth plugin.
|
||||
`keystoneauth1.identity.V3Password` auth plugin.
|
||||
|
||||
Example::
|
||||
|
||||
from keystoneclient.auth import identity
|
||||
from keystoneclient import session
|
||||
from barbicanclient import client
|
||||
from keystoneauth1 import identity
|
||||
from keystoneauth1 import session
|
||||
|
||||
auth = identity.v3.Password(auth_url='http://localhost:5000/v3',
|
||||
username='admin_user',
|
||||
user_domain_name='Default',
|
||||
password='password',
|
||||
project_name='demo'
|
||||
project_domain_name='Default')
|
||||
auth = identity.V3Password(auth_url='http://localhost:5000/v3',
|
||||
username='admin_user',
|
||||
user_domain_name='Default',
|
||||
password='password',
|
||||
project_name='demo',
|
||||
project_domain_name='Default')
|
||||
sess = session.Session(auth=auth)
|
||||
barbican = client.Client(session=sess)
|
||||
|
||||
@@ -35,18 +35,18 @@ Keystone API Version 2 Authentication
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Authentication using Keystone API Version 2 can be achieved using the
|
||||
`keystoneclient.auth.identity.v2.Password` auth plugin.
|
||||
`keystoneauth1.identity.V2Password` auth plugin.
|
||||
|
||||
Example::
|
||||
|
||||
from keystoneclient.auth import identity
|
||||
from keystoneclient import session
|
||||
from barbicanclient import client
|
||||
from keystoneauth1 import identity
|
||||
from keystoneauth1 import session
|
||||
|
||||
auth = identity.v2.Password(auth_url='http://localhost:5000/v2.0',
|
||||
username='admin_user',
|
||||
password='password',
|
||||
tenant_name='demo')
|
||||
auth = identity.V2Password(auth_url='http://localhost:5000/v2.0',
|
||||
username='admin_user',
|
||||
password='password',
|
||||
tenant_name='demo')
|
||||
sess = session.Session(auth=auth)
|
||||
barbican = client.Client(session=sess)
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ import logging
|
||||
from functionaltests.base import BaseTestCase
|
||||
from functionaltests.common import config
|
||||
from barbicanclient import client
|
||||
from keystoneclient.auth import identity
|
||||
from keystoneclient import session
|
||||
from keystoneauth1 import identity
|
||||
from keystoneauth1 import session
|
||||
|
||||
CONF = config.get_config()
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ from functionaltests.base import BaseTestCase
|
||||
from functionaltests.common import config
|
||||
from barbicanclient import client
|
||||
from barbicanclient import exceptions
|
||||
from keystoneclient.auth import identity
|
||||
from keystoneclient import session
|
||||
from keystoneclient import exceptions as ks_exceptions
|
||||
from keystoneauth1 import identity
|
||||
from keystoneauth1 import session
|
||||
from keystoneauth1 import exceptions as ks_exceptions
|
||||
|
||||
CONF = config.get_config()
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
pbr>=1.6 # Apache-2.0
|
||||
requests>=2.10.0 # Apache-2.0
|
||||
six>=1.9.0 # MIT
|
||||
python-keystoneclient!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
cliff>=2.2.0 # Apache-2.0
|
||||
oslo.config>=3.14.0 # Apache-2.0
|
||||
keystoneauth1>=2.14.0 # Apache-2.0
|
||||
oslo.i18n>=2.1.0 # Apache-2.0
|
||||
oslo.serialization>=1.10.0 # Apache-2.0
|
||||
oslo.utils>=3.16.0 # Apache-2.0
|
||||
|
||||
Reference in New Issue
Block a user