Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37851668
en ru br
ALT Linux repos
S:1.4-alt3

Group :: Monitoring
RPM: nagios-plugins-check_monit

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: fix-encode-py3.patch
Download


From 8e4f5bbb8c60be0412d2918946ba7c9d94af5654 Mon Sep 17 00:00:00 2001
From: Andrey Bychkov <mrdrew@altlinux.org>
Date: Wed, 6 Nov 2019 11:14:25 +0300
Subject: [PATCH] fix func of encoding according python3
---
 check_monit.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/check_monit.py b/check_monit.py
index c3df132..d6f8991 100644
--- a/check_monit.py
+++ b/check_monit.py
@@ -101,7 +101,7 @@ def get_status():
 
     if opts.username and opts.password:
         import base64
-        headers['Authorization'] = 'Basic ' + (base64.encodestring(opts.username + ':' + opts.password)).strip()
+        headers['Authorization'] = 'Basic ' + base64.encodebytes(('%s:%s' % (opts.username, opts.password)).encode()).decode().replace('\n', '')
     
     try:
         connection.request('GET','/_status?format=xml',headers=headers)
-- 
2.21.0
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin