Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.4.4
-
all
Description
improve the HostInfo.py (Host Check) during the ambari installer process, particularly for step 3 of the process where the nodes are registered and confirmed. In particular this JIRA will address the erroneous iptables check that currently always returns a value of 0 which indicates in the script that iptables is running and active, even when the iptables have actually been flushed. This results in an erroneous warning message.
suggested improvements:
1. existing users and directories created during RHS GlusterFS install - test for existence of gluster and then if found follow the existing suppressed control block
REPO_ARTIFACT_PATH = "/var/lib/ambari-agent/data/"
REPO_ARTIFACT_FILE = "HDP-*.Gluster"
REPO_ARTIFACT_SEARCH = "%s%s" % (REPO_ARTIFACT_PATH,REPO_ARTIFACT_FILE) + "*"
gluster_artifact_result = glob.glob(REPO_ARTIFACT_SEARCH)
GLUSTER_FS_PATH = "/mnt/glusterfs"
gluster_fs_result = glob.glob(GLUSTER_FS_PATH)
isGluster = gluster_artifact_result != [] or gluster_fs_result != []
if componentsMapped or commandsInProgress or isSuse or isGluster:
dict['existingRepos'] = [self.RESULT_UNAVAILABLE]
dict['installedPackages'] = []
dict['alternatives'] = []
dict['stackFoldersAndFiles'] = []
dict['existingUsers'] = []
else:
etcs = []
2. iptables improvement - change command to iptables -S. Cleaner output that can be verfied easily to show iptables have been flushed
def checkIptables(self):
iptablesIsRunning = True
try:
iptables = subprocess.Popen(["iptables", "-S"], stdout=subprocess.PIPE)
stdout = iptables.communicate()
if stdout == ('-P INPUT ACCEPT\n-P FORWARD ACCEPT\n-P OUTPUT ACCEPT\n', None):
iptablesIsRunning = False
except:
pass
dict['iptablesIsRunning'] = self.checkIptables()