summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-10-18 19:41:31 +0000
committerGerrit Code Review <review@openstack.org>2016-10-18 19:41:31 +0000
commit20bb32f8d8272aee14f8e349fe1a0536c1c8ab68 (patch)
treef413fa9c38844bb9ea7b354efb6250e2470aa458
parente16a6f5c44b112a1d39be2611ff9c6781a010bb7 (diff)
parent274b91a72306aefce4c0001db676de86dc48b52b (diff)
downloadpython-barbicanclient-20bb32f8d8272aee14f8e349fe1a0536c1c8ab68.tar.gz
Merge "Use keystoneauth"
-rw-r--r--barbicanclient/barbican.py9
-rw-r--r--barbicanclient/client.py4
-rw-r--r--barbicanclient/tests/test_client.py2
-rw-r--r--doc/source/authentication.rst38
-rw-r--r--functionaltests/client/base.py4
-rw-r--r--functionaltests/client/test_client_connectivity.py6
-rw-r--r--requirements.txt2
7 files changed, 33 insertions, 32 deletions
diff --git a/barbicanclient/barbican.py b/barbicanclient/barbican.py
index 1aa505f..e35a7e2 100644
--- a/barbicanclient/barbican.py
+++ b/barbicanclient/barbican.py
@@ -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):
diff --git a/barbicanclient/client.py b/barbicanclient/client.py
index 17fabbb..d47b764 100644
--- a/barbicanclient/client.py
+++ b/barbicanclient/client.py
@@ -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
diff --git a/barbicanclient/tests/test_client.py b/barbicanclient/tests/test_client.py
index 20f5e42..c4a2033 100644
--- a/barbicanclient/tests/test_client.py
+++ b/barbicanclient/tests/test_client.py
@@ -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
diff --git a/doc/source/authentication.rst b/doc/source/authentication.rst
index d375205..1032553 100644
--- a/doc/source/authentication.rst
+++ b/doc/source/authentication.rst
@@ -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
-
- 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')
+ from keystoneauth1 import identity
+ from keystoneauth1 import session
+
+ 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)
diff --git a/functionaltests/client/base.py b/functionaltests/client/base.py
index 3eb3cb6..f408f1f 100644
--- a/functionaltests/client/base.py
+++ b/functionaltests/client/base.py
@@ -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()
diff --git a/functionaltests/client/test_client_connectivity.py b/functionaltests/client/test_client_connectivity.py
index 217dc33..a734342 100644
--- a/functionaltests/client/test_client_connectivity.py
+++ b/functionaltests/client/test_client_connectivity.py
@@ -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()
diff --git a/requirements.txt b/requirements.txt
index 00a02b9..c44fd34 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -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