Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 99DCB200B4A for ; Wed, 15 Jun 2016 02:27:31 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 985FC160A56; Wed, 15 Jun 2016 00:27:31 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 18A51160A63 for ; Wed, 15 Jun 2016 02:27:30 +0200 (CEST) Received: (qmail 25997 invoked by uid 500); 15 Jun 2016 00:27:30 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 25892 invoked by uid 99); 15 Jun 2016 00:27:30 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2016 00:27:30 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1FB822C1F62 for ; Wed, 15 Jun 2016 00:27:30 +0000 (UTC) Date: Wed, 15 Jun 2016 00:27:30 +0000 (UTC) From: "Masahiro Tanaka (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (AMBARI-17047) Firewall check returns WARNING even if iptables and firewalld are stopped on CentOS7 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 15 Jun 2016 00:27:31 -0000 [ https://issues.apache.org/jira/browse/AMBARI-17047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Masahiro Tanaka reassigned AMBARI-17047: ---------------------------------------- Assignee: Masahiro Tanaka > Firewall check returns WARNING even if iptables and firewalld are stopped on CentOS7 > ------------------------------------------------------------------------------------ > > Key: AMBARI-17047 > URL: https://issues.apache.org/jira/browse/AMBARI-17047 > Project: Ambari > Issue Type: Bug > Components: ambari-agent, ambari-server > Affects Versions: trunk > Environment: CentOS7.2 > Reporter: Masahiro Tanaka > Assignee: Masahiro Tanaka > Labels: patch > Attachments: AMBARI-17047.patch > > > In firewall.py, {{"systemctl is-active iptables || systemctl is-active firewalld"}} is passed to {{run_in_shell}} function, which splits cmd string by using {{shlex.split}}. > {{run_in_shell}} function finally calls {{subprocess.Popen}} with {{shell=True}}, so the cmd string is evaluated like {{Popen(['/bin/sh', '-c', 'systemctl', 'is-active', 'iptables', '||', 'systemctl', 'is-active', 'firewalld'])}}. This doesn't returns values as expected, because after args[1] (in this case, after the first {{is-active}}) are evaluated as sh arguements. > {{systemctl is-active}} can take multiple arugments, so we can use it. -- This message was sent by Atlassian JIRA (v6.3.4#6332)