def get_faults(self, entity_instance_id): resp = fm_core.get_by_eid(entity_instance_id) if resp is False: raise APIException("Failed to execute get_faults.") elif resp: data = [] for i in resp: data.append(self._str_to_alarm(i)) return data else: return None
def get_faults(self, entity_instance_id): try: resp = fm_core.get_by_eid(entity_instance_id) if resp: data = [] for i in resp: data.append(self._str_to_alarm(i)) return data except (RuntimeError, SystemError, TypeError): pass return None