adapt to python-novaclient-2.18.0

Novaclient renamed HTTPNotImplemented to HttpNotImplemented
and changed the attribute code to status in exceptions

This change should make the code work on newer and older versions.

Closes-Bug: #1340596
(cherry picked from commit 322004f848)

Conflicts:
	openstack_dashboard/dashboards/project/instances/console.py
	openstack_dashboard/test/test_data/exceptions.py

Change-Id: Ifef6c4c1b2924b03df00f427cfe3e6a7f415e569
This commit is contained in:
Matthias Runge 2014-07-11 12:45:19 +02:00
parent 32a7b71346
commit 937436f95c
1 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,11 @@ def create_stubbed_exception(cls, status_code=500):
msg = "Expected failure."
def fake_init_exception(self, code, message, **kwargs):
self.code = code
if code is not None:
if hasattr(self, 'http_status'):
self.http_status = code
else:
self.code = code
self.message = message
def fake_str(self):