<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: config.py script - how to disable json file creation in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198326#M76503</link>
    <description>&lt;P&gt;just to explain my case , when we run the script more then 100 times then 100 json file created , so we want to avoid the files creation because we run the script under /.../.../sbin folder &lt;/P&gt;</description>
    <pubDate>Tue, 27 Mar 2018 20:26:49 GMT</pubDate>
    <dc:creator>mike_bronson7</dc:creator>
    <dc:date>2018-03-27T20:26:49Z</dc:date>
    <item>
      <title>config.py script - how to disable json file creation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198323#M76500</link>
      <description>&lt;P&gt;when we set new values by the config.py script&lt;/P&gt;&lt;P&gt;script created also the file ( example - doSet_version1522153623088712.json )&lt;/P&gt;&lt;P&gt;is it possoible to flag the script in way to disable this file creation ? &lt;/P&gt;&lt;PRE&gt;/var/lib/ambari-server/resources/scripts/configs.py --user=admin --password=admin  --port=8080 --action=set --host=master02 --cluster=hdp  --config-type=spark2-thrift-sparkconf -k spark.executor.instances -v 8

ls


doSet_version1522153623088712.json&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Mar 2018 19:37:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198323#M76500</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-03-27T19:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: config.py script - how to disable json file creation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198324#M76501</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;There is no such flag with which the file creation can be disabled. If you want to write to a existing valid file, you can pass the file name using -f option.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;-Aditya&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 20:22:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198324#M76501</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-03-27T20:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: config.py script - how to disable json file creation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198325#M76502</link>
      <description>&lt;P&gt;if we cant block the file creation then is it possible to write this file on other folder as /var/tmp insted my curent folder ? &lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 20:25:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198325#M76502</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-03-27T20:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: config.py script - how to disable json file creation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198326#M76503</link>
      <description>&lt;P&gt;just to explain my case , when we run the script more then 100 times then 100 json file created , so we want to avoid the files creation because we run the script under /.../.../sbin folder &lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 20:26:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198326#M76503</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2018-03-27T20:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: config.py script - how to disable json file creation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198327#M76504</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;It is not supported by the script by default. But you can add a line to the script and make it work. Assume you want to store output in /tmp/myconfigs&lt;/P&gt;&lt;PRE&gt;mkdir /tmp/myconfigs&lt;BR /&gt;chmod 777 /tmp/myconfigs&lt;/PRE&gt;&lt;P&gt;Modify the script as below. Find the function 'output_to_file' and the below line&lt;/P&gt;&lt;PRE&gt;filename = os.path.join('/tmp','myconfigs',filename)&lt;/PRE&gt;&lt;P&gt;The function should look like below. Make sure indentation is proper. Python has strict checking for indentation&lt;/P&gt;&lt;PRE&gt;def output_to_file(filename):
  filename = os.path.join('/tmp','myconfigs',filename)
  def output(config):
    with open(filename, 'w') as out_file:
      json.dump(config, out_file, indent=2)
  return output&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Mar 2018 21:05:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198327#M76504</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2018-03-27T21:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: config.py script - how to disable json file creation</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198328#M76505</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/26229/uribarih.html" nodeid="26229"&gt;@Michael Bronson&lt;/A&gt;&lt;P&gt;Try commenting the below line in configs.py&lt;/P&gt;&lt;PRE&gt;    118   #output_to_file(new_file)(new_config)&lt;/PRE&gt;&lt;P&gt;I did a basic validation and it works. PUT option alone creates output file by default and GET has a flag -f. &lt;/P&gt;&lt;P&gt;We are basically commenting the PUT operations output file.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Mar 2018 21:19:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/config-py-script-how-to-disable-json-file-creation/m-p/198328#M76505</guid>
      <dc:creator>sandyy006</dc:creator>
      <dc:date>2018-03-27T21:19:23Z</dc:date>
    </item>
  </channel>
</rss>

