Merge "remove persistency tables from db"
This commit is contained in:
commit
642b588ce3
@ -73,9 +73,6 @@ changes_interval = 5
|
|||||||
|
|
||||||
[datasources]
|
[datasources]
|
||||||
snapshots_interval = 120
|
snapshots_interval = 120
|
||||||
|
|
||||||
[persistency]
|
|
||||||
enable_persistency=true
|
|
||||||
EOF
|
EOF
|
||||||
)"
|
)"
|
||||||
|
|
||||||
|
@ -27,10 +27,11 @@ class CollectorNotifier(object):
|
|||||||
self.oslo_notifier = None
|
self.oslo_notifier = None
|
||||||
try:
|
try:
|
||||||
topics = [conf.datasources.notification_topic_collector]
|
topics = [conf.datasources.notification_topic_collector]
|
||||||
if conf.persistency.enable_persistency:
|
# TODO(idan_hefetz): persistency is in development
|
||||||
topics.append(conf.persistency.persistor_topic)
|
# if conf.persistency.enable_persistency:
|
||||||
else:
|
# topics.append(conf.persistency.persistor_topic)
|
||||||
LOG.warning("Not persisting events")
|
# else:
|
||||||
|
# LOG.warning("Not persisting events")
|
||||||
|
|
||||||
self.oslo_notifier = oslo_messaging.Notifier(
|
self.oslo_notifier = oslo_messaging.Notifier(
|
||||||
get_transport(conf),
|
get_transport(conf),
|
||||||
|
@ -79,8 +79,13 @@ class Connection(base.Connection):
|
|||||||
def upgrade(self, nocreate=False):
|
def upgrade(self, nocreate=False):
|
||||||
engine = self._engine_facade.get_engine()
|
engine = self._engine_facade.get_engine()
|
||||||
engine.connect()
|
engine.connect()
|
||||||
models.Base.metadata.drop_all(engine, tables=[models.Event.__table__])
|
models.Base.metadata.drop_all(
|
||||||
models.Base.metadata.create_all(engine)
|
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
|
# TODO(idan_hefetz) upgrade logic is missing
|
||||||
|
|
||||||
def disconnect(self):
|
def disconnect(self):
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
import time
|
import time
|
||||||
|
import unittest
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_db.options import database_opts
|
from oslo_db.options import database_opts
|
||||||
@ -42,6 +43,7 @@ class TestGraphPersistor(TestFunctionalBase):
|
|||||||
cls.load_datasources(cls.conf)
|
cls.load_datasources(cls.conf)
|
||||||
cls.graph_persistor = GraphPersistor(cls.conf)
|
cls.graph_persistor = GraphPersistor(cls.conf)
|
||||||
|
|
||||||
|
@unittest.skip("persistency is disabled in queens")
|
||||||
def test_persist_graph(self):
|
def test_persist_graph(self):
|
||||||
g = GraphGenerator().create_graph()
|
g = GraphGenerator().create_graph()
|
||||||
current_time = utcnow()
|
current_time = utcnow()
|
||||||
@ -51,6 +53,7 @@ class TestGraphPersistor(TestFunctionalBase):
|
|||||||
self.assert_graph_equal(g, graph_snapshot)
|
self.assert_graph_equal(g, graph_snapshot)
|
||||||
self.graph_persistor.delete_graph_snapshots(utcnow())
|
self.graph_persistor.delete_graph_snapshots(utcnow())
|
||||||
|
|
||||||
|
@unittest.skip("persistency is disabled in queens")
|
||||||
def test_persist_two_graphs(self):
|
def test_persist_two_graphs(self):
|
||||||
g1 = GraphGenerator().create_graph()
|
g1 = GraphGenerator().create_graph()
|
||||||
current_time1 = utcnow()
|
current_time1 = utcnow()
|
||||||
@ -68,6 +71,7 @@ class TestGraphPersistor(TestFunctionalBase):
|
|||||||
self.assert_graph_equal(g2, graph_snapshot2)
|
self.assert_graph_equal(g2, graph_snapshot2)
|
||||||
self.graph_persistor.delete_graph_snapshots(utcnow())
|
self.graph_persistor.delete_graph_snapshots(utcnow())
|
||||||
|
|
||||||
|
@unittest.skip("persistency is disabled in queens")
|
||||||
def test_load_last_graph_snapshot_until_timestamp(self):
|
def test_load_last_graph_snapshot_until_timestamp(self):
|
||||||
g1 = GraphGenerator().create_graph()
|
g1 = GraphGenerator().create_graph()
|
||||||
self.graph_persistor.last_event_timestamp = utcnow()
|
self.graph_persistor.last_event_timestamp = utcnow()
|
||||||
@ -85,6 +89,7 @@ class TestGraphPersistor(TestFunctionalBase):
|
|||||||
self.assert_graph_equal(g1, graph_snapshot)
|
self.assert_graph_equal(g1, graph_snapshot)
|
||||||
self.graph_persistor.delete_graph_snapshots(utcnow())
|
self.graph_persistor.delete_graph_snapshots(utcnow())
|
||||||
|
|
||||||
|
@unittest.skip("persistency is disabled in queens")
|
||||||
def test_delete_graph_snapshots(self):
|
def test_delete_graph_snapshots(self):
|
||||||
g = GraphGenerator().create_graph()
|
g = GraphGenerator().create_graph()
|
||||||
self.graph_persistor.last_event_timestamp = utcnow()
|
self.graph_persistor.last_event_timestamp = utcnow()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user