<p>Neels Hofmeyr <strong>merged</strong> this change.</p><p><a href="https://gerrit.osmocom.org/11426">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Neels Hofmeyr: Looks good to me, approved; Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fill_config.py: add NET_DIR variable<br><br>Allow all config files to use a new NET_DIR variable, which always<br>points to the network folder with the generated configs. We can use<br>this to place all temporary files (sockets, pid files, ...) there.<br><br>Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561<br>---<br>M net/README<br>M net/fill_config.py<br>2 files changed, 6 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/net/README b/net/README</span><br><span>index 352bc56..1d07775 100644</span><br><span>--- a/net/README</span><br><span>+++ b/net/README</span><br><span>@@ -71,7 +71,8 @@</span><br><span> </span><br><span> The fill_config.py script helps to fill the templates with the config values. Simply</span><br><span> invoke fill_config.py with a dir argument (templates dir) and a file argument (specific</span><br><span style="color: hsl(0, 100%, 40%);">-config values).</span><br><span style="color: hsl(120, 100%, 40%);">+config values). The dir argument can be used in the templates with ${NET_DIR},</span><br><span style="color: hsl(120, 100%, 40%);">+temporary files (sockets etc.) should be placed inside this folder.</span><br><span> </span><br><span> If one or both are omitted, the script tries to re-use the most recent paths,</span><br><span> they were stored in local files '.last_config' and '.last_templates'.</span><br><span>diff --git a/net/fill_config.py b/net/fill_config.py</span><br><span>index d0e2e04..c33e6b7 100755</span><br><span>--- a/net/fill_config.py</span><br><span>+++ b/net/fill_config.py</span><br><span>@@ -50,8 +50,9 @@</span><br><span> </span><br><span> local_config_file = os.path.realpath(local_config_file)</span><br><span> tmpl_dir = os.path.realpath(tmpl_dir)</span><br><span style="color: hsl(120, 100%, 40%);">+net_dir = os.path.realpath(".")</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-print('using config file %r\non templates %r' % (local_config_file, tmpl_dir))</span><br><span style="color: hsl(120, 100%, 40%);">+print('using config file %r\non templates %r\nwith NET_DIR %r' % (local_config_file, tmpl_dir, net_dir))</span><br><span> </span><br><span> with open(LAST_LOCAL_CONFIG_FILE, 'w') as last_file:</span><br><span>   last_file.write(local_config_file)</span><br><span>@@ -59,7 +60,8 @@</span><br><span>   last_file.write(tmpl_dir)</span><br><span> </span><br><span> # read in variable values from config file</span><br><span style="color: hsl(0, 100%, 40%);">-local_config = {}</span><br><span style="color: hsl(120, 100%, 40%);">+# NET_DIR is the folder where fill_config.py was started</span><br><span style="color: hsl(120, 100%, 40%);">+local_config = {"NET_DIR": net_dir}</span><br><span> </span><br><span> line_nr = 0</span><br><span> for line in open(local_config_file):</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11426">change 11426</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/11426"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-dev </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561 </div>
<div style="display:none"> Gerrit-Change-Number: 11426 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>