You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by am...@apache.org on 2019/08/01 14:02:48 UTC
[ambari] branch branch-2.7 updated: AMBARI-23469 HostCleanup.py
script is failing with AttributeError: 'NoneType' object has no attribute
'get' (#3061)
This is an automated email from the ASF dual-hosted git repository.
amagyar pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push:
new b059611 AMBARI-23469 HostCleanup.py script is failing with AttributeError: 'NoneType' object has no attribute 'get' (#3061)
b059611 is described below
commit b05961104ea272a6885d03ce6978eb03422479d4
Author: payert <35...@users.noreply.github.com>
AuthorDate: Thu Aug 1 16:02:42 2019 +0200
AMBARI-23469 HostCleanup.py script is failing with AttributeError: 'NoneType' object has no attribute 'get' (#3061)
Change-Id: Id07397049da792bfa2f8e9c36e19871baf385fe5
---
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 c6f5bff..113bfa2 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()