From c2e3a8c6e638f366b08eea9d62c8206099bda613 Mon Sep 17 00:00:00 2001 From: Frank Sachsenheim Date: Tue, 7 May 2024 15:24:06 +0200 Subject: [PATCH] apt_info.py: Uses docstring for module documentation Signed-off-by: Frank Sachsenheim --- apt_info.py | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/apt_info.py b/apt_info.py index 90f2b52..7abb2cf 100755 --- a/apt_info.py +++ b/apt_info.py @@ -1,24 +1,26 @@ #!/usr/bin/env python3 -# -# Description: Expose metrics from apt. This is inspired by and -# intended to be a replacement for the original apt.sh. -# -# This script deliberately does *not* update the apt cache. You need -# something else to run `apt update` regularly for the metrics to be -# up to date. This can be done in numerous ways, but the canonical way -# is to use the normal `APT::Periodic::Update-Package-Lists` -# setting. -# -# This, for example, will enable a nightly job that runs `apt update`: -# -# echo 'APT::Periodic::Update-Package-Lists "1";' > /etc/apt/apt.conf.d/99_auto_apt_update.conf -# -# See /usr/lib/apt/apt.systemd.daily for details. -# -# Dependencies: python3-apt, python3-prometheus-client -# -# Authors: Kyle Fazzari -# Daniel Swarbrick + +""" +Description: Expose metrics from apt. This is inspired by and +intended to be a replacement for the original apt.sh. + +This script deliberately does *not* update the apt cache. You need +something else to run `apt update` regularly for the metrics to be +up to date. This can be done in numerous ways, but the canonical way +is to use the normal `APT::Periodic::Update-Package-Lists` +setting. + +This, for example, will enable a nightly job that runs `apt update`: + + echo 'APT::Periodic::Update-Package-Lists "1";' > /etc/apt/apt.conf.d/99_auto_apt_update.conf + +See /usr/lib/apt/apt.systemd.daily for details. + +Dependencies: python3-apt, python3-prometheus-client + +Authors: Kyle Fazzari + Daniel Swarbrick +""" import apt import apt_pkg