Remove glanceclient and warlock from shade
We've removed the uses - remove both from requirements. Change-Id: Ie3f2354d2034a695ae9086f84f5d6c7f3698d90b
This commit is contained in:
parent
dd25a3c416
commit
24acc1888b
@ -13,7 +13,6 @@ keystoneauth1>=2.11.0
|
||||
netifaces>=0.10.4
|
||||
python-novaclient>=2.21.0,!=2.27.0,!=2.32.0
|
||||
python-keystoneclient>=0.11.0
|
||||
python-glanceclient>=1.0.0
|
||||
python-cinderclient>=1.3.1
|
||||
python-neutronclient>=2.3.10
|
||||
python-troveclient>=1.2.0
|
||||
|
@ -454,9 +454,6 @@ def obj_to_dict(obj, request_id=None):
|
||||
# If we obj_to_dict twice, don't fail, just return the munch
|
||||
# Also, don't try to modify Mock objects - that way lies madness
|
||||
return obj
|
||||
elif hasattr(obj, 'schema') and hasattr(obj, 'validate'):
|
||||
# It's a warlock
|
||||
return _log_request_id(warlock_to_dict(obj), request_id)
|
||||
elif isinstance(obj, dict):
|
||||
# The new request-id tracking spec:
|
||||
# https://specs.openstack.org/openstack/nova-specs/specs/juno/approved/log-request-id-mappings.html
|
||||
@ -496,6 +493,10 @@ def obj_list_to_dict(obj_list, request_id=None):
|
||||
|
||||
|
||||
def warlock_to_dict(obj):
|
||||
# This function is unused in shade - but it is a public function, so
|
||||
# removing it would be rude. We don't actually have to depend on warlock
|
||||
# ourselves to keep this - so just leave it here.
|
||||
#
|
||||
# glanceclient v2 uses warlock to construct its objects. Warlock does
|
||||
# deep black magic to attribute look up to support validation things that
|
||||
# means we cannot use normal obj_to_dict
|
||||
|
@ -29,7 +29,6 @@ import requestsexceptions
|
||||
from six.moves import urllib
|
||||
|
||||
import cinderclient.exceptions as cinder_exceptions
|
||||
import glanceclient
|
||||
import heatclient.client
|
||||
import magnumclient.exceptions as magnum_exceptions
|
||||
from heatclient.common import event_utils
|
||||
@ -959,6 +958,7 @@ class OpenStackCloud(_normalize.Normalizer):
|
||||
|
||||
@property
|
||||
def glance_client(self):
|
||||
import glanceclient
|
||||
if self._glance_client is None:
|
||||
self._glance_client = self._get_client(
|
||||
'image', glanceclient.Client)
|
||||
|
@ -13,7 +13,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
import mock
|
||||
import warlock
|
||||
|
||||
from neutronclient.common import exceptions as neutron_exceptions
|
||||
|
||||
@ -954,22 +953,3 @@ class TestMeta(base.TestCase):
|
||||
self.assertIn('foo', obj_dict)
|
||||
self.assertEqual(obj_dict['additional'], 1)
|
||||
self.assertEqual(obj_dict['foo'], 'bar')
|
||||
|
||||
def test_warlock_to_dict(self):
|
||||
schema = {
|
||||
'name': 'Test',
|
||||
'properties': {
|
||||
'id': {'type': 'string'},
|
||||
'name': {'type': 'string'},
|
||||
'_unused': {'type': 'string'},
|
||||
}
|
||||
}
|
||||
test_model = warlock.model_factory(schema)
|
||||
test_obj = test_model(
|
||||
id='471c2475-da2f-47ac-aba5-cb4aa3d546f5',
|
||||
name='test-image')
|
||||
test_dict = meta.obj_to_dict(test_obj)
|
||||
self.assertNotIn('_unused', test_dict)
|
||||
self.assertEqual('test-image', test_dict['name'])
|
||||
self.assertTrue(hasattr(test_dict, 'name'))
|
||||
self.assertEqual(test_dict.name, test_dict['name'])
|
||||
|
@ -12,6 +12,5 @@ sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
|
||||
testrepository>=0.0.17
|
||||
testscenarios>=0.4,<0.5
|
||||
testtools>=0.9.32
|
||||
warlock>=1.0.1,<2
|
||||
reno
|
||||
futures;python_version<'3.2'
|
||||
|
Loading…
Reference in New Issue
Block a user