From f351db55311825662f1514259b0a9d4eff9fd25d Mon Sep 17 00:00:00 2001 From: "Ladue, David (dl3158)" Date: Mon, 1 Oct 2018 13:14:17 -0400 Subject: fix daily log roll bug Change-Id: I5c472ceafed99bb1b619c36d31371e51ad17bb4b Issue-ID: DCAEGEN2-842 Signed-off-by: Ladue, David (dl3158) --- snmptrap/snmptrapd.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/snmptrap/snmptrapd.py b/snmptrap/snmptrapd.py index d2b53f3..8a824ef 100644 --- a/snmptrap/snmptrapd.py +++ b/snmptrap/snmptrapd.py @@ -176,12 +176,12 @@ def log_all_arriving_traps(): if curr_hour != tds.last_hour: roll_all_logs() tds.last_hour = curr_hour - else: - # otherwise, assume daily roll - curr_day = datetime.datetime.now().day - if curr_day != tds.last_day: - roll_all_logs() - tds.last_day = curr_day + else: + # otherwise, assume daily roll + curr_day = datetime.datetime.now().day + if curr_day != tds.last_day: + roll_all_logs() + tds.last_day = curr_day # always log arriving trap try: -- cgit 1.2.3-korg