diff --git a/argo-nagios-ams-publisher.spec b/argo-nagios-ams-publisher.spec index ec286b8..cfce8c5 100644 --- a/argo-nagios-ams-publisher.spec +++ b/argo-nagios-ams-publisher.spec @@ -10,8 +10,8 @@ %endif Name: argo-nagios-ams-publisher -Version: 0.3.5 -Release: 2%{mydist} +Version: 0.3.6 +Release: 1%{mydist} Summary: Bridge from Nagios to the ARGO Messaging system Group: Network/Monitoring @@ -109,6 +109,8 @@ if ! /usr/bin/getent group nagiocmd &>/dev/null; then fi %changelog +* Tue Mar 31 2020 Daniel Vrcic - 0.3.6-1%{?dist} +- ARGO-2224 Local delivery cache tool should pass non-ascii characters * Tue Apr 23 2019 Daniel Vrcic - 0.3.5-2%{?dist} - regression fix to include site name in `site` field of notification * Wed Apr 17 2019 Daniel Vrcic - 0.3.5-1%{?dist} diff --git a/init/ams-publisher.service b/init/ams-publisher.service index b21235b..a628f1d 100644 --- a/init/ams-publisher.service +++ b/init/ams-publisher.service @@ -1,11 +1,11 @@ [Unit] -Description=AMS publisher +Description=AMS publisher After=network.target [Service] Type=simple -ExecStart=/usr/bin/ams-publisherd -d start -ExecStop=/usr/bin/ams-publisherd -d stop +ExecStart=/usr/bin/ams-publisherd -d start +ExecStop=/usr/bin/ams-publisherd -d stop [Install] -WantedBy=multiāˆ’user.target +WantedBy=multi-user.target 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 diff --git a/pymod/metrictoqueue.py b/pymod/metrictoqueue.py index 0f4c909..9e512e1 100644 --- a/pymod/metrictoqueue.py +++ b/pymod/metrictoqueue.py @@ -30,15 +30,15 @@ def build_msg(args, *headers): timestamp, service, hostname, metric, status, nagioshost = headers - msg.header.update({'timestamp': timestamp.encode('utf-8')}) - msg.header.update({'service': service.encode('utf-8')}) - msg.header.update({'hostname': hostname.encode('utf-8')}) - msg.header.update({'metric': metric.encode('utf-8')}) - msg.header.update({'status': status.encode('utf-8')}) - msg.header.update({'monitoring_host': nagioshost.encode('utf-8')}) + msg.header.update({'timestamp': timestamp}) + msg.header.update({'service': service}) + msg.header.update({'hostname': hostname}) + msg.header.update({'metric': metric}) + msg.header.update({'status': status}) + msg.header.update({'monitoring_host': nagioshost}) for bs in ['summary', 'message', 'vofqan', 'voname', 'roc', 'actual_data', 'site']: - 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 diff --git a/pymod/publish.py b/pymod/publish.py index 16ab165..ea55b9a 100644 --- a/pymod/publish.py +++ b/pymod/publish.py @@ -127,7 +127,7 @@ def _extract_body(self, body, fields, maps=None): if maps and key in maps: key = maps[key] - msg[key] = value.decode('utf-8', 'replace') + msg[key] = value return msg