This is an automated email from the ASF dual-hosted git repository.
vjasani 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 69c402c928 AMBARI-26068: Fix python3 type error on trunk reader and
collections.Mapping (#3780)
69c402c928 is described below
commit 69c402c928b26fda62ac9cbe4b54f287d5c2f100
Author: jialiang <[email protected]>
AuthorDate: Wed Apr 17 11:12:48 2024 +0800
AMBARI-26068: Fix python3 type error on trunk reader and
collections.Mapping (#3780)
---
ambari-agent/src/main/python/ambari_agent/Utils.py | 4 ++--
ambari-common/src/main/python/ambari_commons/shell.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ambari-agent/src/main/python/ambari_agent/Utils.py
b/ambari-agent/src/main/python/ambari_agent/Utils.py
index 61286e9c5e..256d505cfc 100644
--- a/ambari-agent/src/main/python/ambari_agent/Utils.py
+++ b/ambari-agent/src/main/python/ambari_agent/Utils.py
@@ -111,8 +111,8 @@ class Utils(object):
Update the dictionary 'd' and its sub-dictionaries with values of
dictionary 'u' and its sub-dictionaries.
"""
for k, v in u.items():
- if isinstance(d, collections.Mapping):
- if isinstance(v, collections.Mapping):
+ if isinstance(d, collections.abc.Mapping):
+ if isinstance(v, collections.abc.Mapping):
r = Utils.update_nested(d.get(k, {}), v)
d[k] = r
else:
diff --git a/ambari-common/src/main/python/ambari_commons/shell.py
b/ambari-common/src/main/python/ambari_commons/shell.py
index cedcde74ea..8b28255eab 100644
--- a/ambari-common/src/main/python/ambari_commons/shell.py
+++ b/ambari-common/src/main/python/ambari_commons/shell.py
@@ -325,7 +325,7 @@ def chunks_reader(cmd, kill_timer):
if not data_chunk:
break
- str_buffer += data_chunk
+ str_buffer += data_chunk.decode()
if os.linesep in str_buffer:
copy_offset = str_buffer.rindex(os.linesep)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]