X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=osm_policy_module%2Fcore%2Fdatabase.py;h=9bd8ac82e679675d0c61c21d15e56bdbb8976d69;hb=023473295ef70215b9603e1fa0de8d71c0f6d0a2;hp=e522b8d97effad8006f4143583ecb6641c1bc4ea;hpb=a4e615d9bab28eefa0ae1e713ad75289ed2f65cc;p=osm%2FPOL.git diff --git a/osm_policy_module/core/database.py b/osm_policy_module/core/database.py index e522b8d..9bd8ac8 100644 --- a/osm_policy_module/core/database.py +++ b/osm_policy_module/core/database.py @@ -75,5 +75,8 @@ class DatabaseManager: db.connect() db.create_tables([ScalingGroup, ScalingPolicy, ScalingCriteria, ScalingAlarm]) db.close() - except Exception as e: + except Exception: log.exception("Error creating tables: ") + + def get_alarm(self, alarm_id: str): + return ScalingAlarm.select().where(ScalingAlarm.alarm_id == alarm_id).get()