From 6e7645948d8352312b4381247ed1d0cfb031c703 Mon Sep 17 00:00:00 2001 From: Daniel Vrcic Date: Thu, 6 Feb 2020 20:31:19 +0100 Subject: [PATCH] same for alarms - no encode/decode --- pymod/alarmtoqueue.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pymod/alarmtoqueue.py b/pymod/alarmtoqueue.py index 888cc78..83409c8 100644 --- a/pymod/alarmtoqueue.py +++ b/pymod/alarmtoqueue.py @@ -28,14 +28,14 @@ def build_msg(args, *headers): timestamp, service, hostname, testname, status, nagioshost = headers - msg.header.update({'execution_time': timestamp.encode('utf-8')}) - msg.header.update({'service_flavour': service.encode('utf-8')}) - msg.header.update({'node_name': hostname.encode('utf-8')}) - msg.header.update({'test_name': testname.encode('utf-8')}) - msg.header.update({'status': status.encode('utf-8')}) + msg.header.update({'execution_time': timestamp}) + msg.header.update({'service_flavour': service}) + msg.header.update({'node_name': hostname}) + msg.header.update({'test_name': testname}) + msg.header.update({'status': status}) for bs in ['details', 'vo', 'site', 'roc', 'urlhistory', 'urlhelp']: - code = "msg.body += '%s: ' + args.%s.encode(\'utf-8\') + '\\n' if args.%s else ''" % (bs, bs, bs) + code = "msg.body += '%s: ' + args.%s + '\\n' if args.%s else ''" % (bs, bs, bs) exec code msg.text = True