diff --git a/extras/install-tips.sh b/extras/install-tips.sh index 50c2fd8da..d96773ac4 100644 --- a/extras/install-tips.sh +++ b/extras/install-tips.sh @@ -15,7 +15,6 @@ # limitations under the License. for lib in \ - python-novaclient \ python-keystoneclient \ python-ironicclient \ os-client-config \ diff --git a/releasenotes/notes/remove-novaclient-3f8d4db20d5f9582.yaml b/releasenotes/notes/remove-novaclient-3f8d4db20d5f9582.yaml new file mode 100644 index 000000000..bd0ffbf4a --- /dev/null +++ b/releasenotes/notes/remove-novaclient-3f8d4db20d5f9582.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - All Nova interactions are done via direct REST calls. + python-novaclient is no longer a direct dependency of + shade. diff --git a/requirements.txt b/requirements.txt index 8f25d2a85..fbf6c0081 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,6 @@ iso8601>=0.1.11 # MIT keystoneauth1>=2.21.0 # Apache-2.0 netifaces>=0.10.4 # MIT -python-novaclient>=9.0.0 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0 python-ironicclient>=1.11.0 # Apache-2.0 diff --git a/shade/__init__.py b/shade/__init__.py index 3d5af0401..35e7ee98e 100644 --- a/shade/__init__.py +++ b/shade/__init__.py @@ -53,11 +53,6 @@ def simple_logging(debug=False, http_debug=False): log = _log.setup_logging('keystoneauth') log.addHandler(logging.StreamHandler()) log.setLevel(log_level) - # Enable HTTP level tracing of novaclient - logger = logging.getLogger('novaclient') - log.addHandler(logging.StreamHandler()) - log.setLevel(log_level) - logger.propagate = False # We only want extra shade HTTP tracing in http debug mode log = _log.setup_logging('shade.http') log.setLevel(log_level) diff --git a/shade/_legacy_clients.py b/shade/_legacy_clients.py index 4b5ec1066..c18eea1a4 100644 --- a/shade/_legacy_clients.py +++ b/shade/_legacy_clients.py @@ -65,8 +65,7 @@ class LegacyClientFactoryMixin(object): @property def nova_client(self): - return self._create_legacy_client( - 'nova', 'compute', version='2.0', deprecated=False) + return self._create_legacy_client('nova', 'compute', version='2.0') @property def glance_client(self): diff --git a/shade/_utils.py b/shade/_utils.py index 1e7e768db..bf8abd6f7 100644 --- a/shade/_utils.py +++ b/shade/_utils.py @@ -25,7 +25,6 @@ import sys import time from decorator import decorator -from novaclient import exceptions as nova_exc from shade import _log from shade import exc @@ -445,10 +444,6 @@ def shade_exceptions(error_message=None): yield except exc.OpenStackCloudException: raise - except nova_exc.BadRequest as e: - if error_message is None: - error_message = str(e) - raise exc.OpenStackCloudBadRequest(error_message) except Exception as e: if error_message is None: error_message = str(e) diff --git a/shade/tests/base.py b/shade/tests/base.py index 73d1e86bb..81e6450bc 100644 --- a/shade/tests/base.py +++ b/shade/tests/base.py @@ -76,12 +76,6 @@ class TestCase(testtools.TestCase): logger.addHandler(handler) logger.propagate = False - # Enable HTTP level tracing - logger = logging.getLogger('novaclient') - logger.setLevel(logging.DEBUG) - logger.addHandler(handler) - logger.propagate = False - def assertEqual(self, first, second, *args, **kwargs): '''Munch aware wrapper''' if isinstance(first, munch.Munch): diff --git a/shade/tests/unit/test_create_server.py b/shade/tests/unit/test_create_server.py index 4ab000aa3..ed1dab4b8 100644 --- a/shade/tests/unit/test_create_server.py +++ b/shade/tests/unit/test_create_server.py @@ -31,8 +31,8 @@ class TestCreateServer(base.RequestsMockTestCase): def test_create_server_with_get_exception(self): """ - Test that an exception when attempting to get the server instance via - the novaclient raises an exception in create_server. + Test that a bad status code when attempting to get the server instance + raises an exception in create_server. """ build_server = fakes.make_fake_server('1234', '', 'BUILD') self.register_uris([ @@ -173,7 +173,7 @@ class TestCreateServer(base.RequestsMockTestCase): def test_create_server_no_wait(self): """ Test that create_server with no wait and no exception in the - novaclient create call returns the server instance. + create call returns the server instance. """ fake_server = fakes.make_fake_server('1234', '', 'BUILD') self.register_uris([ diff --git a/shade/tests/unit/test_rebuild_server.py b/shade/tests/unit/test_rebuild_server.py index dd588a26b..aae725245 100644 --- a/shade/tests/unit/test_rebuild_server.py +++ b/shade/tests/unit/test_rebuild_server.py @@ -41,7 +41,7 @@ class TestRebuildServer(base.RequestsMockTestCase): def test_rebuild_server_rebuild_exception(self): """ - Test that an exception in the novaclient rebuild raises an exception in + Test that an exception in the rebuild raises an exception in rebuild_server. """ self.register_uris([ @@ -120,7 +120,7 @@ class TestRebuildServer(base.RequestsMockTestCase): def test_rebuild_server_no_wait(self): """ Test that rebuild_server with no wait and no exception in the - novaclient rebuild call returns the server instance. + rebuild call returns the server instance. """ self.register_uris([ dict(method='POST', diff --git a/shade/tests/unit/test_server_set_metadata.py b/shade/tests/unit/test_server_set_metadata.py index 2af4787af..0b32ae6e8 100644 --- a/shade/tests/unit/test_server_set_metadata.py +++ b/shade/tests/unit/test_server_set_metadata.py @@ -34,10 +34,6 @@ class TestServerSetMetadata(base.RequestsMockTestCase): self.server_id, self.server_name) def test_server_set_metadata_with_exception(self): - """ - Test that a generic exception in the novaclient delete_meta raises - an exception in delete_server_metadata. - """ self.register_uris([ dict(method='GET', uri=self.get_mock_url( diff --git a/shade/tests/unit/test_update_server.py b/shade/tests/unit/test_update_server.py index ec50694be..2a94c13c1 100644 --- a/shade/tests/unit/test_update_server.py +++ b/shade/tests/unit/test_update_server.py @@ -36,7 +36,7 @@ class TestUpdateServer(base.RequestsMockTestCase): def test_update_server_with_update_exception(self): """ - Test that an exception in the novaclient update raises an exception in + Test that an exception in the update raises an exception in update_server. """ self.register_uris([