Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6C763C447 for ; Fri, 14 Nov 2014 21:19:35 +0000 (UTC) Received: (qmail 86729 invoked by uid 500); 14 Nov 2014 21:19:35 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 86681 invoked by uid 500); 14 Nov 2014 21:19:34 -0000 Mailing-List: contact dev-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 dev@ambari.apache.org Received: (qmail 86514 invoked by uid 99); 14 Nov 2014 21:19:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Nov 2014 21:19:34 +0000 Date: Fri, 14 Nov 2014 21:19:34 +0000 (UTC) From: "Enrique Flores (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMBARI-8320) configs.sh doConfigFileUpdate fails when multiple occurrences of word "properties" found MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-8320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14212841#comment-14212841 ] Enrique Flores commented on AMBARI-8320: ---------------------------------------- looks like same issue is present in configs.sh from branch-1.7.0 > configs.sh doConfigFileUpdate fails when multiple occurrences of word "properties" found > ----------------------------------------------------------------------------------------- > > Key: AMBARI-8320 > URL: https://issues.apache.org/jira/browse/AMBARI-8320 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: 1.6.1, 1.7.0 > Reporter: Enrique Flores > Attachments: AMBARI-8320.patch > > > When running configs.sh to read in a properties file per doConfigFileUpdate, the update fails with the following error: > {noformat} > [root@node-0 out2]# bash -x /var/lib/ambari-server/resources/scripts/configs.sh set localhost DC-2 hdfs-log4j hdfs-log4j.txt > + USERID=admin > + PASSWD=admin > + PORT=:8080 > + SSL_URL_PREFIX= > + '[' set == -u ']' > + '[' set == -p ']' > + '[' set == -port ']' > + '[' set == -s ']' > + AMBARIURL=http://localhost:8080 > + CLUSTER=DC-2 > + SITE=hdfs-log4j > + SITETAG= > + CONFIGKEY=hdfs-log4j.txt > + CONFIGVALUE= > + case "$1" in > + (( 5 == 6 )) > + (( 5 == 5 )) > + doConfigFileUpdate hdfs-log4j.txt > + FILENAME=hdfs-log4j.txt > + '[' -f hdfs-log4j.txt ']' > ++ cut -d : -f 1 > ++ grep -n properties hdfs-log4j.txt > + '[' 1 == '1 > 2' ']' > + echo '[ERROR] File "hdfs-log4j.txt" should be in the following JSON format:' > [ERROR] File "hdfs-log4j.txt" should be in the following JSON format: > + echo '[ERROR] "properties": {' > [ERROR] "properties": { > + echo '[ERROR] "key1": "value1",' > [ERROR] "key1": "value1", > + echo '[ERROR] "key2": "value2",' > [ERROR] "key2": "value2", > + echo '[ERROR] }' > [ERROR] } > + exit 1 > [root@node-0 out2]# > {noformat} > In this example, there are multiple occurrences of the word "properties" in the hdfs-log4j.txt properties file I'm trying to read in: > {noformat} > [root@node-0 out2]# grep -n properties hdfs-log4j.txt | cut -d: -f 1 > 1 > 2 > [root@node-0 out2]# > [root@node-0 out2]# grep -n -o -P '(properties)\S+' hdfs-log4j.txt > 1:properties" > 2:properties\nhadoop.root.logger=INFO,console\nhadoop.log.dir=.\nhadoop.log.file=hadoop.log\n\n\n# > [root@node-0 out2]# > {noformat} > The file I'm trying to read in is formatted properly , but configs.sh fails due to the grep test in doConfigFileUpdate not passing. -- This message was sent by Atlassian JIRA (v6.3.4#6332)