You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by wu...@apache.org on 2022/11/14 16:33:40 UTC
[ambari] branch trunk updated: AMBARI-23469: HostCleanup.py script is failing with AttributeError: 'NoneType' object has no attribute 'get' (#3487)
This is an automated email from the ASF dual-hosted git repository.
wuzhiguo 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 1623fab83b AMBARI-23469: HostCleanup.py script is failing with AttributeError: 'NoneType' object has no attribute 'get' (#3487)
1623fab83b is described below
commit 1623fab83bd0ced72bf6a64445031d0be8f3cef8
Author: Zhiguo Wu <wu...@apache.org>
AuthorDate: Tue Nov 15 00:33:33 2022 +0800
AMBARI-23469: HostCleanup.py script is failing with AttributeError: 'NoneType' object has no attribute 'get' (#3487)
---
ambari-agent/src/main/python/ambari_agent/HostCleanup.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
index 07224aeb3c..8e9273c4a8 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
@@ -141,9 +141,14 @@ class HostCleanup:
dirList = argMap.get(DIR_SECTION)
repoList = argMap.get(REPO_SECTION)
proc_map = argMap.get(PROCESS_SECTION)
- procList = proc_map.get(PROCESS_KEY)
- procUserList = proc_map.get(PROCESS_OWNER_KEY)
- procIdentifierList = proc_map.get(PROCESS_IDENTIFIER_KEY)
+ if proc_map:
+ procList = proc_map.get(PROCESS_KEY)
+ procUserList = proc_map.get(PROCESS_OWNER_KEY)
+ procIdentifierList = proc_map.get(PROCESS_IDENTIFIER_KEY)
+ else:
+ procList = []
+ procUserList = []
+ procIdentifierList = []
alt_map = argMap.get(ALT_SECTION)
additionalDirList = self.get_additional_dirs()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org