From ba1deb704b69306cd1f6876e8fc83f8a391db828 Mon Sep 17 00:00:00 2001 From: vitrinekast Date: Tue, 26 Mar 2024 23:20:01 +0100 Subject: [PATCH] remove debug fiesta --- script.py | 19 ++++++++----------- templates/book.jinja | 27 --------------------------- 2 files changed, 8 insertions(+), 38 deletions(-) diff --git a/script.py b/script.py index 260f6c4..ee12d21 100644 --- a/script.py +++ b/script.py @@ -61,10 +61,10 @@ logins_today_log = subprocess.run(["sudo", "journalctl","_COMM=systemd-logind", # TODO: merge into one command and then grep the various _COMM\s, wrap in a function -groupadd_today_log = subprocess.run(["sudo", "journalctl","_COMM=groupadd","-r"], check=True, capture_output=True) -groupremove_today_log = subprocess.run(["sudo", "journalctl","_COMM=groupremove","-r"], check=True, capture_output=True) -usermod_today_log = subprocess.run(["sudo", "journalctl","_COMM=usermod","-r"], check=True, capture_output=True) -userdel_today_log = subprocess.run(["sudo", "journalctl","_COMM=userdel","-r"], check=True, capture_output=True) +groupadd_today_log = subprocess.run(["sudo", "journalctl", "-S","today","_COMM=groupadd","-r"], check=True, capture_output=True) +groupremove_today_log = subprocess.run(["sudo", "journalctl", "-S","today","_COMM=groupremove","-r"], check=True, capture_output=True) +usermod_today_log = subprocess.run(["sudo", "journalctl", "-S","today","_COMM=usermod","-r"], check=True, capture_output=True) +userdel_today_log = subprocess.run(["sudo", "journalctl", "-S","today","_COMM=userdel","-r"], check=True, capture_output=True) kitchen_services = run_command(["sudo", "journalctl", "-S", "today", "-u", "kitchen-stove.service", "-u", "kitchen-bin.service", "-u", "kitchen-fridge.service", "-r", "-n"]).splitlines() @@ -80,14 +80,11 @@ output = template.render( now = now.strftime("%B %dth %Y"), last_user_added=last_user_added.stdout.decode('UTF-8'), last_user_added_name=last_user_added_name, - # users_created_today=users_created_today, - users_created_today=fallback, + users_created_today=users_created_today, since_last_boot=since_last_boot, - list_package_installs=[], - # list_package_upgrade=list_package_upgrade, - list_package_upgrade=[], - # list_package_remove=list_package_remove, - list_package_remove=[], + list_package_installs=list_package_installs, + list_package_upgrade=list_package_upgrade, + list_package_remove=list_package_remove, device_info=device_info, days_since_last_boot = time_since_last_boot.days, kitchen_services = kitchen_services, diff --git a/templates/book.jinja b/templates/book.jinja index 2d9f3c7..b48b840 100644 --- a/templates/book.jinja +++ b/templates/book.jinja @@ -35,33 +35,6 @@ {% endif %} {%- endmacro %} -
-

Debug fiesta!

-
-last_user_added: {{ last_user_added}}
-last_user_added_name: {{ last_user_added_name}}
-users_created_today: {{ users_created_today}}
-since_last_boot: {{ since_last_boot}}
-list_package_installs: {{ list_package_installs}}
-list_package_upgrade: {{ list_package_upgrade}}
-list_package_remove: {{ list_package_remove}}
-device_info: {{ device_info}}
-days_since_last_boot : {{ days_since_last_boot }}
-kitchen_services : {{ kitchen_services }}
-ip_address : {{ ip_address }}
-logins_today : {{ logins_today }}
-list_groups : {{ list_groups }}
-list_active_services : {{ list_active_services }}
-debian_version : {{ debian_version }}
-kernel_version : {{ kernel_version }}
-hostname : {{ hostname }}
-
-groups_created : {{ groups_created }}
-groups_removed : {{ groups_removed }}
-user_modified : {{ user_modified }}
-user_deleted : {{ user_deleted }}
-
-

Preface