Merge "remove flag fault_management_pod_disabled"

This commit is contained in:
Zuul 2019-09-23 16:55:46 +00:00 committed by Gerrit Code Review
commit fa8070f218
3 changed files with 4 additions and 30 deletions

View File

@ -141,9 +141,6 @@ class FaultManagement(alarm_handlers_v1.AlarmHandler):
_openstack_token = None
_openstack_directory = None
_openstack_fm_endpoint_disabled = False
# This flag is used to disable raising alarm to containerized fm
# and will be removed in future.
_fault_management_pod_disabled = True
@property
def name(self):
@ -225,9 +222,7 @@ class FaultManagement(alarm_handlers_v1.AlarmHandler):
fault = self._format_alarm(alarm_data)
if fault is not None:
# conditional statement 'self._fault_management_pod_disabled' is used
# to disable raising alarm to containerized fm and will be removed in future.
if "instance" in alarm_data.entity_type and (not self._fault_management_pod_disabled):
if "instance" in alarm_data.entity_type:
fm_uuid = self._raise_openstack_alarm(fault.as_dict())
self._openstack_alarm_db[alarm_uuid] = (alarm_data, fm_uuid)
else:
@ -375,10 +370,7 @@ class FaultManagement(alarm_handlers_v1.AlarmHandler):
def audit_alarms(self):
DLOG.debug("Auditing alarms begin.")
# conditional statement 'self._fault_management_pod_disabled' is used
# to disable raising alarm to containerized fm and will be removed in future.
if not self._fault_management_pod_disabled:
self._audit_openstack_alarms()
self._audit_openstack_alarms()
self._audit_platform_alarms()
DLOG.debug("Audited alarms end.")
@ -391,10 +383,6 @@ class FaultManagement(alarm_handlers_v1.AlarmHandler):
DISABLED_LIST = ['Yes', 'yes', 'Y', 'y', 'True', 'true', 'T', 't', '1']
self._openstack_fm_endpoint_disabled = (config.CONF['fm']['endpoint_disabled'] in DISABLED_LIST)
# self._fault_management_pod_disabled is used to disable
# raising alarm to containerized fm and will be removed in future.
self._fault_management_pod_disabled = \
(config.CONF['openstack'].get('fault_management_pod_disabled', 'True') in DISABLED_LIST)
def finalize(self):
return

View File

@ -347,9 +347,6 @@ class EventLogManagement(event_log_handlers_v1.EventLogHandler):
_openstack_token = None
_openstack_directory = None
_openstack_fm_endpoint_disabled = False
# _fault_management_pod_disabled is used to disable
# raising alarm to containerized fm and will be removed in future.
_fault_management_pod_disabled = True
@property
def name(self):
@ -428,10 +425,7 @@ class EventLogManagement(event_log_handlers_v1.EventLogHandler):
fault = self._format_log(log_data)
if fault is not None:
fm_uuid = None
# conditional statements self._fault_management_pod_disabled
# is used to disable raising alarm to containerized fm and
# will be removed in future.
if "instance" in log_data.entity_type and (not self._fault_management_pod_disabled):
if "instance" in log_data.entity_type:
fm_uuid = self._raise_openstack_log(fault.as_dict())
else:
fm_uuid = self._fm_api.set_fault(fault)
@ -452,10 +446,6 @@ class EventLogManagement(event_log_handlers_v1.EventLogHandler):
DISABLED_LIST = ['Yes', 'yes', 'Y', 'y', 'True', 'true', 'T', 't', '1']
self._openstack_fm_endpoint_disabled = (config.CONF['fm']['endpoint_disabled'] in DISABLED_LIST)
# _fault_management_pod_disabled is used to disable raising alarm
# to containerized fm and will be removed in future.
self._fault_management_pod_disabled = \
(config.CONF['openstack'].get('fault_management_pod_disabled', 'True') in DISABLED_LIST)
def finalize(self):
return

View File

@ -50,12 +50,8 @@ def nfvi_initialize(config):
'False') in DISABLED_LIST)
guest_plugin_disabled = (config.get('guest_plugin_disabled',
'False') in DISABLED_LIST)
# 'fault_management_pod_disabled' is used to disable get alarms
# from containerized fm and will be removed in future.
fault_mgmt_plugin_disabled = (config.get('fault_mgmt_plugin_disabled',
'False') in DISABLED_LIST) or \
(config.get('fault_management_pod_disabled',
'True') in DISABLED_LIST)
'False') in DISABLED_LIST)
_task_worker_pools['identity'] = \
tasks.TaskWorkerPool('Identity', num_workers=1)