From 5b2a6354a6a7ff1c52e7d4c8737b1de77dddd7aa Mon Sep 17 00:00:00 2001 From: Idan Hefetz Date: Wed, 31 Jan 2018 13:03:01 +0000 Subject: [PATCH] remove persistency tables from db this feature is not completed Depends-On: I971bcca223dd1e2e8c78ebe03b582d7cc8eee976 Change-Id: I5d2a78332a54ee892d37f2cca062dc461c0b17f9 --- devstack/gate_hook.sh | 3 --- vitrage/datasources/collector_notifier.py | 9 +++++---- vitrage/storage/impl_sqlalchemy.py | 9 +++++++-- .../entity_graph/graph_persistor/test_graph_persistor.py | 5 +++++ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/devstack/gate_hook.sh b/devstack/gate_hook.sh index c8f28110e..6c0cc4fdc 100644 --- a/devstack/gate_hook.sh +++ b/devstack/gate_hook.sh @@ -73,9 +73,6 @@ changes_interval = 5 [datasources] snapshots_interval = 120 - -[persistency] -enable_persistency=true EOF )" diff --git a/vitrage/datasources/collector_notifier.py b/vitrage/datasources/collector_notifier.py index 54da41429..a0ef0b23d 100644 --- a/vitrage/datasources/collector_notifier.py +++ b/vitrage/datasources/collector_notifier.py @@ -27,10 +27,11 @@ class CollectorNotifier(object): self.oslo_notifier = None try: topics = [conf.datasources.notification_topic_collector] - if conf.persistency.enable_persistency: - topics.append(conf.persistency.persistor_topic) - else: - LOG.warning("Not persisting events") + # TODO(idan_hefetz): persistency is in development + # if conf.persistency.enable_persistency: + # topics.append(conf.persistency.persistor_topic) + # else: + # LOG.warning("Not persisting events") self.oslo_notifier = oslo_messaging.Notifier( get_transport(conf), diff --git a/vitrage/storage/impl_sqlalchemy.py b/vitrage/storage/impl_sqlalchemy.py index 554f599cf..850c9bf75 100644 --- a/vitrage/storage/impl_sqlalchemy.py +++ b/vitrage/storage/impl_sqlalchemy.py @@ -79,8 +79,13 @@ class Connection(base.Connection): def upgrade(self, nocreate=False): engine = self._engine_facade.get_engine() engine.connect() - models.Base.metadata.drop_all(engine, tables=[models.Event.__table__]) - models.Base.metadata.create_all(engine) + models.Base.metadata.drop_all( + engine, tables=[models.Event.__table__, + models.GraphSnapshot.__table__]) + models.Base.metadata.create_all( + engine, tables=[models.ActiveAction.__table__, + models.Template.__table__, + models.Webhooks.__table__]) # TODO(idan_hefetz) upgrade logic is missing def disconnect(self): diff --git a/vitrage/tests/functional/entity_graph/graph_persistor/test_graph_persistor.py b/vitrage/tests/functional/entity_graph/graph_persistor/test_graph_persistor.py index e54348c63..59e9516bd 100644 --- a/vitrage/tests/functional/entity_graph/graph_persistor/test_graph_persistor.py +++ b/vitrage/tests/functional/entity_graph/graph_persistor/test_graph_persistor.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. import time +import unittest from oslo_config import cfg from oslo_db.options import database_opts @@ -42,6 +43,7 @@ class TestGraphPersistor(TestFunctionalBase): cls.load_datasources(cls.conf) cls.graph_persistor = GraphPersistor(cls.conf) + @unittest.skip("persistency is disabled in queens") def test_persist_graph(self): g = GraphGenerator().create_graph() current_time = utcnow() @@ -51,6 +53,7 @@ class TestGraphPersistor(TestFunctionalBase): self.assert_graph_equal(g, graph_snapshot) self.graph_persistor.delete_graph_snapshots(utcnow()) + @unittest.skip("persistency is disabled in queens") def test_persist_two_graphs(self): g1 = GraphGenerator().create_graph() current_time1 = utcnow() @@ -68,6 +71,7 @@ class TestGraphPersistor(TestFunctionalBase): self.assert_graph_equal(g2, graph_snapshot2) self.graph_persistor.delete_graph_snapshots(utcnow()) + @unittest.skip("persistency is disabled in queens") def test_load_last_graph_snapshot_until_timestamp(self): g1 = GraphGenerator().create_graph() self.graph_persistor.last_event_timestamp = utcnow() @@ -85,6 +89,7 @@ class TestGraphPersistor(TestFunctionalBase): self.assert_graph_equal(g1, graph_snapshot) self.graph_persistor.delete_graph_snapshots(utcnow()) + @unittest.skip("persistency is disabled in queens") def test_delete_graph_snapshots(self): g = GraphGenerator().create_graph() self.graph_persistor.last_event_timestamp = utcnow()