[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2017-04-18 Thread Sumit Mohanty (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sumit Mohanty updated AMBARI-15754:
---
Fix Version/s: 2.4.3

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>Assignee: Asger Askov Blekinge
>  Labels: easyfix, patch
> Fix For: trunk, 2.5.0, 2.4.3
>
> Attachments: AMBARI-15754-branch-2.5.patch, 
> AMBARI-15754_trunk_v3.patch, AMBARI-15754.v2.patch
>
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2017-02-23 Thread Sumit Mohanty (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sumit Mohanty updated AMBARI-15754:
---
Fix Version/s: 2.5.0

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>Assignee: Asger Askov Blekinge
>  Labels: easyfix, patch
> Fix For: trunk, 2.5.0
>
> Attachments: AMBARI-15754-branch-2.5.patch, 
> AMBARI-15754_trunk_v3.patch, AMBARI-15754.v2.patch
>
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2017-02-23 Thread Madhuvanthi Radhakrishnan (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Madhuvanthi Radhakrishnan updated AMBARI-15754:
---
Attachment: AMBARI-15754-branch-2.5.patch
AMBARI-15754_trunk_v3.patch

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>Assignee: Asger Askov Blekinge
>  Labels: easyfix, patch
> Fix For: trunk
>
> Attachments: AMBARI-15754-branch-2.5.patch, 
> AMBARI-15754_trunk_v3.patch, AMBARI-15754.v2.patch
>
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2017-02-22 Thread Alejandro Fernandez (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alejandro Fernandez updated AMBARI-15754:
-
Attachment: AMBARI-15754.v2.patch

[~blekinge], I'm redacting your patch in the comments and creating a patch that 
I tested with a subset of your changes.

+1 for [^AMBARI-15754.v2.patch]

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>Assignee: Asger Askov Blekinge
>  Labels: easyfix, patch
> Fix For: trunk
>
> Attachments: AMBARI-15754.v2.patch
>
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2017-02-22 Thread Alejandro Fernandez (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alejandro Fernandez updated AMBARI-15754:
-
Attachment: (was: AMBARI-15754.v2.patch)

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>Assignee: Asger Askov Blekinge
>  Labels: easyfix, patch
> Fix For: trunk
>
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2017-02-22 Thread Alejandro Fernandez (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alejandro Fernandez updated AMBARI-15754:
-
Status: Open  (was: Patch Available)

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>Assignee: Asger Askov Blekinge
>  Labels: easyfix, patch
> Fix For: trunk
>
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2017-02-22 Thread Alejandro Fernandez (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alejandro Fernandez updated AMBARI-15754:
-
Fix Version/s: trunk

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>Assignee: Asger Askov Blekinge
>  Labels: easyfix, patch
> Fix For: trunk
>
> Attachments: AMBARI-15754.v2.patch
>
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2017-02-21 Thread Alejandro Fernandez (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alejandro Fernandez updated AMBARI-15754:
-
Attachment: AMBARI-15754.v2.patch

I tested this during a GET call and only had to modify a couple of places. See 
[^AMBARI-15754.v2.patch]
Will test POST during update to see if the rest need to change.

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>  Labels: easyfix, patch
> Attachments: AMBARI-15754.v2.patch
>
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2016-04-07 Thread Asger Askov Blekinge (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Asger Askov Blekinge updated AMBARI-15754:
--
Labels: easyfix patch  (was: )

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>  Labels: easyfix, patch
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the working directory
> So,
> {code}
>  "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) 
> under one\n# or more contributor license agreements.  See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership.  The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License.  You may obtain a copy of the License 
> at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required 
> by applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# * Set root logger level to DEBUG and its only 
> appender to A.\nlog4j.logger.org.apache.pig=info, A\n\n# * A is set to be 
> a ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# 
> * A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> will be output as 
> {code}
> "content" : "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under 
> one\n# or more contributor license agreements. See the NOTICE file\n# 
> distributed with this work for additional information\n# regarding copyright 
> ownership. The ASF licenses this file\n# to you under the Apache License, 
> Version 2.0 (the\n# \"License\"); you may not use this file except in 
> compliance\n# with the License. You may obtain a copy of the License at\n#\n# 
> http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by 
> applicable law or agreed to in writing,\n# software distributed under the 
> License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR 
> CONDITIONS OF ANY\n# KIND, either express or implied. See the License for 
> the\n# specific language governing permissions and limitations\n# under the 
> License.\n#\n#\n#\n\n# bigr configs.sh gpfs mmls ssh symphony Set root logger 
> level to DEBUG and its only appender to A.\nlog4j.logger.org.apache.pig=info, 
> A\n\n# bigr configs.sh gpfs mmls ssh symphony A is set to be a 
> ConsoleAppender.\nlog4j.appender.A=org.apache.log4j.ConsoleAppender\n# bigr 
> configs.sh gpfs mmls ssh symphony A uses 
> PatternLayout.\nlog4j.appender.A.layout=org.apache.log4j.PatternLayout\nlog4j.appender.A.layout.ConversionPattern=%-4r
>  [%t] %-5p %c %x - %m%n"
> {code}
> As you can see, there are no * string in the output any longer, but 
> instead it has been replaced with "bigr configs.sh gpfs mmls ssh symphony" 
> which happened to be the local files in my working dir. 
> It all comes from this line in configs.sh, line 241-247
> {code}
> if [ "$propertiesStarted" -gt "0" ]; then
>   if [ -z $FILENAME ]; then
> echo $line
>   else
> echo $line >> $FILENAME
>   fi
> fi
> {code}
> where the echo do not quote the $line to output



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (AMBARI-15754) configs.sh expands ***** in config values to a local file list, causing broken config files

2016-04-07 Thread Asger Askov Blekinge (JIRA)

 [ 
https://issues.apache.org/jira/browse/AMBARI-15754?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Asger Askov Blekinge updated AMBARI-15754:
--
Status: Patch Available  (was: Open)

{code}
Index: ambari-server/src/main/resources/scripts/configs.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===
--- ambari-server/src/main/resources/scripts/configs.sh (revision 
96bdecf8474064465b2ecc1261152d9ba68730e2)
+++ ambari-server/src/main/resources/scripts/configs.sh (revision )
@@ -127,7 +127,7 @@
   fi
 fi
 if [ "$propertiesStarted" -gt 0 ]; then
-  if [ "`echo $line | grep -E "},?$"`" ]; then
+  if [ "`echo "$line" | grep -E "},?$"`" ]; then
 ## Properties ended
 ## Add property
 propLen=${#newProperties}
@@ -146,7 +146,7 @@
 fi
 newProperties=$newProperties$line
 propertiesStarted=0
-  elif [ "`echo $line | grep "\\\"$CONFIGKEY\\\""`" ]; then
+  elif [ "`echo "$line" | grep "\\\"$CONFIGKEY\\\""`" ]; then
 echo "## Config found. Skipping origin value"
   else
 newProperties=$newProperties$line
@@ -154,9 +154,9 @@
 elif [ "$attributesStarted" -gt 0 ]; then
   newProperties=$newProperties$line
 fi
-if [ "`echo $line | grep -E "{$"`" ]; then
+if [ "`echo "$line" | grep -E "{$"`" ]; then
 currentLevel=$((currentLevel+1))
-elif [ "`echo $line | grep -E "},?$"`" ]; then
+elif [ "`echo "$line" | grep -E "},?$"`" ]; then
 currentLevel=$((currentLevel-1))
 if [ "$currentLevel" == 1 ]; then
   # if no properties in current config
@@ -168,7 +168,7 @@
   finalJson="{ \"Clusters\": { \"desired_config\": {\"type\": 
\"$SITE\", \"tag\":\"$newTag\", $newProperties}}}"
   newFile="doSet_$newTag.json"
   echo "## PUTting json into: $newFile"
-  echo $finalJson > $newFile
+  echo "$finalJson" > $newFile
   curl -k -u $USERID:$PASSWD -X PUT -H "X-Requested-By: ambari" 
"$AMBARIURL/api/v1/clusters/$CLUSTER" --data @$newFile
   currentSiteTag
   echo "## NEW Site:$SITE, Tag:$SITETAG";
@@ -193,7 +193,7 @@
   newProperties=`cat $FILENAME`;
   finalJson="{ \"Clusters\": { \"desired_config\": {\"type\": \"$SITE\", 
\"tag\":\"$newTag\", $newProperties}}}"
   newFile="doSet_$newTag.json"
-  echo $finalJson>$newFile
+  echo "$finalJson">$newFile
   echo "## PUTting file:\"$FILENAME\" into config(type:\"$SITE\", 
tag:$newTag) via $newFile"
   curl -k -u $USERID:$PASSWD -X PUT -H "X-Requested-By: ambari" 
"$AMBARIURL/api/v1/clusters/$CLUSTER" --data @$newFile
   currentSiteTag
@@ -234,20 +234,20 @@
   curl -k -s -u $USERID:$PASSWD 
"$AMBARIURL/api/v1/clusters/$CLUSTER/configurations?type=$SITE&tag=$SITETAG" | 
while read -r line; do
 # echo ">>> $line";
 if [ "$propertiesStarted" -eq 0 ]; then
-  if [ "`echo $line | grep "\"properties\""`" -o "`echo $line | grep 
"\"properties_attributes\""`" ]; then
+  if [ "`echo "$line" | grep "\"properties\""`" -o "`echo "$line" | grep 
"\"properties_attributes\""`" ]; then
 propertiesStarted=$currentLevel
   fi
 fi
 if [ "$propertiesStarted" -gt "0" ]; then
   if [ -z $FILENAME ]; then
-echo $line
+echo "$line"
   else
-echo $line >> $FILENAME
+echo "$line" >> $FILENAME
   fi
 fi
-if [ "`echo $line | grep -E "{$"`" ]; then
+if [ "`echo "$line" | grep -E "{$"`" ]; then
 currentLevel=$((currentLevel+1))
-elif [ "`echo $line | grep -E "},?$"`" ]; then
+elif [ "`echo "$line" | grep -E "},?$"`" ]; then
 currentLevel=$((currentLevel-1))
 fi
 if [ "$propertiesStarted" -eq "$currentLevel" ]; then
{code}

> configs.sh expands * in config values to a local file list, causing 
> broken config files
> ---
>
> Key: AMBARI-15754
> URL: https://issues.apache.org/jira/browse/AMBARI-15754
> Project: Ambari
>  Issue Type: Bug
>  Components: ambari-server
>Affects Versions: 2.0.0, 2.0.1, 2.1.0, 2.3.0, 2.0.2, 2.1.1, 2.1.2, trunk, 
> 2.0.3, 2.2.0, 2.4.0, 2.2.1, 2.2.2, 2.4.1
>Reporter: Asger Askov Blekinge
>
> When you try to get the value of, say, pig-log4j like this, it outputs 
> correctly
> {code}
> curl -k -s -u $AMBARI_USER:$AMBARI_PASSWORD 
> "$AMBARI_HOST:$AMBARI_PORT/api/v1/clusters/$CLUSTER_NAME/configurations?type=pig-log4j&tag=version1"
> {code}
> If you use configs.sh to do the same
> {code}
> configs.sh -u $AMBARI_USER -p $AMBARI_PASSWORD -port $AMBARI_PORT get 
> $AMBARI_HOST $CLUSTER_NAME pig-log4j
> {code}
> it will have replaced the * with the file list in the