Switch to keystoneauth

keytoneclient.auth is deprecated in favour of keystoneauth.
This patch switches keystoneclient.auth to keystoneauth and removes the
keystoneclient requirement as we no longer use it anywhere else.

Change-Id: I96cd9b86cb6d66886df7be483514ed3698602217
This commit is contained in:
Clenimar Filemon 2016-05-31 15:08:49 -03:00
parent 87b4ab66b8
commit b16f8b1692
4 changed files with 14 additions and 15 deletions

View File

@ -37,7 +37,7 @@ Requirements
- gzip, bzip2, xz
- OpenSSL
- python-swiftclient
- python-keystoneclient
- keystoneauth1
- pymongo
- PyMySQL
- libmysqlclient-dev
@ -1169,4 +1169,4 @@ EX::
$ freezer-agent --config /home/user/job2.ini --upload-limit 1k
The Freezer logo is released under the licence Attribution 3.0 Unported (CC BY3.0).
The Freezer logo is released under the licence Attribution 3.0 Unported (CC BY3.0).

View File

@ -19,9 +19,9 @@ client interface to the Freezer API
import os
import socket
from keystoneclient.auth.identity import v2
from keystoneclient.auth.identity import v3
from keystoneclient import session as ksc_session
from keystoneauth1.identity import v2
from keystoneauth1.identity import v3
from keystoneauth1 import session as ksa_session
from oslo_config import cfg
from freezer.apiclient import actions
@ -254,7 +254,7 @@ class Client(object):
if self._session:
return self._session
auth_plugin = get_auth_plugin(self.opts)
return ksc_session.Session(auth=auth_plugin, verify=self.verify)
return ksa_session.Session(auth=auth_plugin, verify=self.verify)
@cached_property
def endpoint(self):

View File

@ -5,7 +5,6 @@ astroid<1.4.0 # LGPL # breaks pylint 1.4.4
setuptools>=16.0 # PSF/ZPL
pbr>=1.6 # Apache-2.0
python-swiftclient>=2.2.0 # Apache-2.0
python-keystoneclient!=1.8.0,!=2.1.0,>=1.6.0 # Apache-2.0
python-cinderclient>=1.6.0 # Apache-2.0
python-glanceclient>=2.0.0 # Apache-2.0
python-novaclient!=2.33.0,>=2.29.0 # Apache-2.0

View File

@ -113,15 +113,15 @@ class TestSupportFunctions(unittest.TestCase):
class TestClientMock(unittest.TestCase):
@patch('freezer.apiclient.client.ksc_session')
@patch('freezer.apiclient.client.ksa_session')
@patch('freezer.apiclient.client.get_auth_plugin')
def test_client_new(self, mock_get_auth_plugin, mock_ksc_session):
def test_client_new(self, mock_get_auth_plugin, mock_ksa_session):
c = client.Client(opts=Mock(), endpoint='blabla')
self.assertIsInstance(c, client.Client)
@patch('freezer.apiclient.client.ksc_session')
@patch('freezer.apiclient.client.ksa_session')
@patch('freezer.apiclient.client.get_auth_plugin')
def test_client_new_with_kwargs(self, mock_get_auth_plugin, mock_ksc_session):
def test_client_new_with_kwargs(self, mock_get_auth_plugin, mock_ksa_session):
kwargs = {'token': 'alpha',
'username': 'bravo',
'password': 'charlie',
@ -145,9 +145,9 @@ class TestClientMock(unittest.TestCase):
self.assertEqual('golf', c.endpoint)
self.assertEqual('hotel', c.version)
@patch('freezer.apiclient.client.ksc_session')
@patch('freezer.apiclient.client.ksa_session')
@patch('freezer.apiclient.client.get_auth_plugin')
def test_get_token(self, mock_get_auth_plugin, mock_ksc_session):
def test_get_token(self, mock_get_auth_plugin, mock_ksa_session):
mock_session = Mock()
mock_session.get_token.return_value = 'antaniX2'
c = client.Client(session=mock_session, endpoint='justtest', opts=Mock())
@ -155,9 +155,9 @@ class TestClientMock(unittest.TestCase):
self.assertEquals(c.auth_token, 'antaniX2')
@patch('freezer.apiclient.client.socket')
@patch('freezer.apiclient.client.ksc_session')
@patch('freezer.apiclient.client.ksa_session')
@patch('freezer.apiclient.client.get_auth_plugin')
def test_get_client_id(self, mock_get_auth_plugin, mock_ksc_session, mock_socket):
def test_get_client_id(self, mock_get_auth_plugin, mock_ksa_session, mock_socket):
mock_socket.gethostname.return_value = 'parmenide'
mock_session = Mock()
mock_session.get_project_id.return_value = 'H2O'