This is an automated email from the ASF dual-hosted git repository.

jialiang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new aef70a95b5 AMBARI-26105: Fix TestPortAlert.py unit test failures in 
Ambari agent due to Python 2 to 3 upgrade (#3800)
aef70a95b5 is described below

commit aef70a95b595693dece108a00264e2d2d365f835
Author: jialiang <[email protected]>
AuthorDate: Wed Jul 31 14:27:22 2024 +0800

    AMBARI-26105: Fix TestPortAlert.py unit test failures in Ambari agent due 
to Python 2 to 3 upgrade (#3800)
---
 ambari-agent/src/test/python/ambari_agent/TestPortAlert.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ambari-agent/src/test/python/ambari_agent/TestPortAlert.py 
b/ambari-agent/src/test/python/ambari_agent/TestPortAlert.py
index 0a47f3b8a5..845a8cf277 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestPortAlert.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestPortAlert.py
@@ -393,7 +393,7 @@ class TestPortAlert(TestCase):
     alert.set_cluster(cluster, cluster_id, host)
     alert.configuration_builder = MagicMock()
     s = socket()
-    s.recv.return_value = "imok"
+    s.recv.return_value = "imok".encode()
 
     def collector_side_effect(clus, data):
       self.assertEqual(data['name'], alert_meta['name'])
@@ -451,7 +451,7 @@ class TestPortAlert(TestCase):
     alert.set_cluster(cluster, cluster_id, host)
     alert.configuration_builder = MagicMock()
     s = socket()
-    s.recv.return_value = "imok"
+    s.recv.return_value = "imok".encode()
 
     def collector_side_effect(clus, data):
       self.assertEqual(data['name'], alert_meta['name'])
@@ -510,7 +510,7 @@ class TestPortAlert(TestCase):
     alert.configuration_builder = MagicMock()
     
     s = socket()
-    s.recv.return_value = "imok"
+    s.recv.return_value = "imok".encode()
 
     def collector_side_effect(clus, data):
       self.assertEqual(data['name'], alert_meta['name'])


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to