check_send_receive_time: Move "states" to inside where they are used.

This commit is contained in:
Alex Vandiver 2024-05-08 18:13:36 +00:00 committed by Tim Abbott
parent 04e21044b9
commit 8bdf1e4a10
1 changed files with 7 additions and 7 deletions

View File

@ -45,15 +45,15 @@ parser.add_argument("--insecure", action="store_true")
options = parser.parse_args() options = parser.parse_args()
states = {
"OK": 0,
"WARNING": 1,
"CRITICAL": 2,
"UNKNOWN": 3,
}
def report(state: str, timestamp: Any = None, msg: Optional[str] = None) -> NoReturn: def report(state: str, timestamp: Any = None, msg: Optional[str] = None) -> NoReturn:
states = {
"OK": 0,
"WARNING": 1,
"CRITICAL": 2,
"UNKNOWN": 3,
}
now = int(time.time()) now = int(time.time())
if msg is None: if msg is None:
msg = f"send time was {timestamp}" msg = f"send time was {timestamp}"