From e41ab6ec83ab435390fd2ea86a4e3bddb8c621d9 Mon Sep 17 00:00:00 2001 From: melissaml Date: Thu, 1 Dec 2016 15:48:14 +0800 Subject: [PATCH] Replaced e.message with str(e) For logging the exception message: e.message has been deprecated. The preferred way is to call str(e). Change-Id: If14adfb9eae5fcd95822b07cea3bd66d16dacea2 --- vitrage/datasources/services.py | 2 +- vitrage_tempest_tests/tests/api/topology/test_topology.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vitrage/datasources/services.py b/vitrage/datasources/services.py index fd1877352..956e5e4b6 100644 --- a/vitrage/datasources/services.py +++ b/vitrage/datasources/services.py @@ -120,5 +120,5 @@ class ChangesService(DatasourceService): for entity in datasource.get_changes(DatasourceAction.UPDATE): self.send_to_queue(entity) except Exception as e: - LOG.error("Get changes Failed - %s", e.message) + LOG.error("Get changes Failed - %s", str(e)) LOG.debug("end get changes") diff --git a/vitrage_tempest_tests/tests/api/topology/test_topology.py b/vitrage_tempest_tests/tests/api/topology/test_topology.py index fc6049854..6e849157b 100644 --- a/vitrage_tempest_tests/tests/api/topology/test_topology.py +++ b/vitrage_tempest_tests/tests/api/topology/test_topology.py @@ -303,7 +303,7 @@ class TestTopology(BaseTopologyTest): except ClientException as e: self.assertEqual(403, e.code) self.assertEqual( - e.message, + str(e), "Graph-type 'graph' requires a 'root' with 'depth'") finally: self._rollback_to_default()