From: Otto Moerbeek Date: Mon, 7 Oct 2024 11:52:54 +0000 (+0200) Subject: Apply suggestions from code review X-Git-Tag: rec-5.2.0-alpha1~41^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14722%2Fhead;p=thirdparty%2Fpdns.git Apply suggestions from code review Co-authored-by: Remi Gacogne --- diff --git a/pdns/recursordist/metrics.py b/pdns/recursordist/metrics.py index 21edb3e81d..469ecebad0 100644 --- a/pdns/recursordist/metrics.py +++ b/pdns/recursordist/metrics.py @@ -15,9 +15,9 @@ print("metrics.py srcdir: " + srcdir + " = " + os.path.realpath(srcdir)) def dedashForSNMP(name): cap = False - ret= '' + ret = '' for ch in name: - if ch =='-': + if ch == '-': cap = True elif cap: ret += ch.upper() diff --git a/pdns/recursordist/metrics_table.py b/pdns/recursordist/metrics_table.py index 8efea77aa1..8ed450dfa6 100644 --- a/pdns/recursordist/metrics_table.py +++ b/pdns/recursordist/metrics_table.py @@ -7,7 +7,7 @@ # - rec-prometheus-gen.h # - rec-snmp-gen.h # -# The .h files are included by the relavant C++ code. +# The .h files are included by the relevant C++ code. # Keep the order sorted by SNMP OID (if present). # # { @@ -16,7 +16,7 @@ # 'desc': One line description ending up in docs, SNMP MIB and Prometheus HELP. Required. A dot is added at the end if absent. # 'longdesc': Extra description added to docs entry. Optional. A dot is added at the end if absent. # 'snmp': 1 SNMP OID count, must be unique. If absent, no SNMP entry is generated -# 'snmpname': Override of SNMP name (if legeacy name did not follow convention) +# 'snmpname': Override of SNMP name (if legacy name did not follow convention) # 'ptype': The promethheus type, default counter. Can also be gauge, histogram, multicounter. Also determines SNMP type. # 'pdesc': Override of Prometheus HELP text, if empty, no Prometheus entry is generated. # 'if': rec_control metrics conditionalized on expression @@ -1176,7 +1176,7 @@ 'desc': 'Number of times internal maintenance has been called, including Lua maintenance', }, - # Entries for aith-rcode-answers are a bit different than others: separate rec_control and SNMP metrics, but a multicounter entry for Prometheus. THe alphabetically firts gets a real pname, the others an empty one. + # Entries for auth-rcode-answers are a bit different than others: separate rec_control and SNMP metrics, but a multicounter entry for Prometheus. The alphabetically first gets a real pname, the others an empty one. # We only generate the Prometheus comment for the first one { 'name': 'auth-noerror-answers',