remove enable_persistency from configuration.

Persistency wont be optional.
This parameter was not used so far thus is simply removed, without deprecating it.

Change-Id: I44baad84429c552b87364fa6659ca2ee193bef58
This commit is contained in:
Idan Hefetz 2018-07-25 08:01:40 +00:00
parent 1db154a043
commit 09a7f43927
6 changed files with 4 additions and 30 deletions

View File

@ -69,9 +69,6 @@ changes_interval = 5
[datasources]
snapshots_interval = 120
[persistency]
enable_persistency=true
EOF
)"

View File

@ -60,9 +60,6 @@ volumes_per_instance=2
vitrage_alarms_per_instance=0
tripleo_controllers=3
zabbix_alarms_per_controller=1
[persistency]
enable_persistency=true
EOF
)"

View File

@ -33,12 +33,8 @@ class GraphPersistency(object):
self.conf = conf
self.db = db
self.graph = graph
self.enabled = conf.persistency.enable_persistency
def store_graph(self):
if not self.enabled:
return
LOG.info('Persisting graph...')
try:
last_event_id = self.db.events.get_last_event_id()
@ -59,8 +55,6 @@ class GraphPersistency(object):
return t
def query_recent_snapshot(self):
if not self.enabled:
return
timestamp = self._recent_snapshot_time()
return self.db.graph_snapshots.query(timestamp=timestamp)
@ -88,11 +82,9 @@ class GraphPersistency(object):
def persist_event(self, before, current, is_vertex, graph, event_id=None):
"""Callback subscribed to driver.graph updates"""
if not self.enabled or\
not self.is_important_change(before,
current,
VProps.UPDATE_TIMESTAMP,
VProps.VITRAGE_SAMPLE_TIMESTAMP):
if not self.is_important_change(
before, current, VProps.UPDATE_TIMESTAMP,
VProps.VITRAGE_SAMPLE_TIMESTAMP):
return
if is_vertex:

View File

@ -17,9 +17,5 @@ from oslo_config import cfg
OPTS = [
cfg.StrOpt('persistor_topic',
default='vitrage_persistor',
help='The topic on which event will be sent from the '
'datasources to the persistor'),
cfg.BoolOpt('enable_persistency',
default=False,
help='Periodically store entity graph snapshot to database'),
help='persistor will listen on this topic for events to store'),
]

View File

@ -34,7 +34,6 @@ class TestGraphPersistor(TestFunctionalBase, TestConfiguration):
cls.conf = cfg.ConfigOpts()
cls.conf.register_opts(cls.PROCESSOR_OPTS, group='entity_graph')
cls.conf.register_opts(cls.DATASOURCES_OPTS, group='datasources')
cls.conf.register_opts(cls.PERSISTENCY_OPTS, group='persistency')
cls.add_db(cls.conf)
cls.load_datasources(cls.conf)
graph_persistency.EPSILON = 0.1

View File

@ -60,13 +60,6 @@ class TestEntityGraphUnitBase(base.BaseTest):
min=1)
]
PERSISTENCY_OPTS = [
cfg.StrOpt('persistor_topic',
default=None),
cfg.BoolOpt('enable_persistency',
default=True),
]
NUM_CLUSTERS = 1
NUM_ZONES = 2
NUM_HOSTS = 4