- with database.db.atomic():
- alarm = HealingActionRepository.get(
- HealingAction.alarm_uuid == alarm_uuid
- )
- vnf_member_index = alarm.vnf_member_index
- vdur_name = alarm.vdur_name
- vdu_id = alarm.vdu_id
- nsr_id = alarm.nsr_id
- heal_type = alarm.recovery_action
- cooldown_time = alarm.cooldown_time
- count_index = alarm.count_index
- last_heal = alarm.last_heal
- day1 = alarm.day1
- vnfinstance_id = alarm.vnfinstance_id
- alarms = HealingActionRepository.list(
- HealingAction.vnf_member_index == vnf_member_index,
- HealingAction.vdur_name == vdur_name
- )
- statuses = []
+ if self.conf.get("autoheal", "enabled") == "True":
+ with database.db.atomic():
+ alarm = HealingActionRepository.get(
+ HealingAction.alarm_uuid == alarm_uuid
+ )
+ vnf_member_index = alarm.vnf_member_index
+ vdur_name = alarm.vdur_name
+ vdu_id = alarm.vdu_id
+ nsr_id = alarm.nsr_id
+ heal_type = alarm.recovery_action
+ cooldown_time = alarm.cooldown_time
+ count_index = alarm.count_index
+ last_heal = alarm.last_heal
+ day1 = alarm.day1
+ vnfinstance_id = alarm.vnfinstance_id
+ alarms = HealingActionRepository.list(
+ HealingAction.vnf_member_index == vnf_member_index,
+ HealingAction.vdur_name == vdur_name,
+ )
+ statuses = []