This commit is contained in:
2024-06-12 17:19:50 +00:00
parent 78fb2f5fff
commit 66193dc27f
2 changed files with 43 additions and 42 deletions

View File

@@ -6,7 +6,9 @@ session = get_session()
if __name__ == "__main__":
group_instances = getGroupInstances()
if group_instances is not []:
if not group_instances:
print("No group instances were found! Nothing to do...")
else:
for instance in group_instances:
try:
db_instance = DBGroupInstance(timestamp=datetime.now(),
@@ -17,6 +19,4 @@ if __name__ == "__main__":
session.commit()
print("Instance log added")
except Exception as e:
print(f"Exception {e}")
else:
print("No group instances! Nothing to do")
print(f"Exception {e}")