[ https://issues.apache.org/jira/browse/METRON-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16170600#comment-16170600 ]
ASF GitHub Bot commented on METRON-1188: ---------------------------------------- Github user justinleet commented on a diff in the pull request: https://github.com/apache/metron/pull/760#discussion_r139526927 --- Diff: metron-platform/metron-common/src/main/java/org/apache/metron/common/cli/ConfigurationManager.java --- @@ -130,29 +201,39 @@ public void pull(CuratorFramework client, String outFileStr, final boolean force public void visit(ConfigurationType configurationType, String name, String data) { File out = getFile(outputDir, configurationType, name); if (!out.exists() || force) { - if(!out.exists()) { + if (!out.exists()) { out.getParentFile().mkdirs(); } try { Files.write(data, out, Charset.defaultCharset()); } catch (IOException e) { throw new RuntimeException("Sorry, something bad happened writing the config to " + out.getAbsolutePath() + ": " + e.getMessage(), e); } - } - else if(out.exists() && !force) { + } else if (out.exists() && !force) { throw new IllegalStateException("Unable to overwrite existing file (" + out.getAbsolutePath() + ") without the force flag (-f or --force) being set."); } } }); } public void push(String inputDirStr, CuratorFramework client) throws Exception { - final File inputDir = new File(inputDirStr); + final File inputDir = new File(inputDirStr); --- End diff -- The examples in the test plan don't work directly because they NPE here. I assume it's because inputDirStr is null here and we only check for validity after wrapping it in a `File`. While you're in here, could you add a check (and meaningful exception) for the case where inputDirStr is null? Error is: ``` [root@node1 zookeeper]# $METRON_HOME/bin/zk_load_configs.sh -z $ZOOKEEPER -m PUSH -c GLOBAL Exception in thread "main" java.lang.NullPointerException at java.io.File.<init>(File.java:277) at org.apache.metron.common.cli.ConfigurationManager.push(ConfigurationManager.java:230) at org.apache.metron.common.cli.ConfigurationManager.run(ConfigurationManager.java:256) at org.apache.metron.common.cli.ConfigurationManager.run(ConfigurationManager.java:242) at org.apache.metron.common.cli.ConfigurationManager.main(ConfigurationManager.java:350) ``` > Ambari global configuration management broken > --------------------------------------------- > > Key: METRON-1188 > URL: https://issues.apache.org/jira/browse/METRON-1188 > Project: Metron > Issue Type: Bug > Reporter: Michael Miklavcic > Assignee: Michael Miklavcic > > Ambari currently ignores values from the UI when managing the global.json > file. These values are hard-coded in the status_params.py file as part of the > mpack. In addition, Ambari restarts are clobbering configuration changes in > Zookeeper. -- This message was sent by Atlassian JIRA (v6.4.14#64029)