rhn-client-tools/SOURCES/1001-fix-base64-encoding-Bug34372838.patch

22 lines
1.3 KiB
Diff

Fix OL9 osad start failure due to base64.encodestring() removal in Python 3.9
Orabug: 34372838
Signed-off-by: Laurence Rochfort <laurence.rochfort@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
---
diff -ruN rhn-client-tools-2.10.10.orig/src/bin/rhn_check.py rhn-client-tools-2.10.10/src/bin/rhn_check.py
--- rhn-client-tools-2.10.10.orig/src/bin/rhn_check.py 2022-07-20 08:00:18.941150794 +0000
+++ rhn-client-tools-2.10.10/src/bin/rhn_check.py 2022-07-20 08:19:54.181497449 +0000
@@ -289,8 +289,8 @@
data['return_code'] = 255
data['process_start'] = '1970-01-01 00:00:00' # dummy values as we have no idea of start
data['process_end'] = '1970-01-01 00:00:00' # and especially about the end
- with open(action_lock) as f:
- data['output'] = base64.encodestring(f.read())
+ with open(action_lock, 'rb') as f:
+ data['output'] = base64.encodebytes(f.read())
log.log_debug("Sending back response", (255, "Previous run of action didn't completed sucessfully, aborting.", data))
ret = self.submit_response(action['id'], 255, "Previous run of action didn't completed sucessfully, aborting.", data)
os.remove(action_lock)