Change in osmo-dev[master]: fill_config.py: add NET_DIR variable

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Oct 22 11:19:11 UTC 2018


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/11426


Change subject: fill_config.py: add NET_DIR variable
......................................................................

fill_config.py: add NET_DIR variable

Allow all config files to use a new NET_DIR variable, which always
points to the network folder with the generated configs. We can use
this to place all temporary files (sockets, pid files, ...) there.

Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561
---
M net/README
M net/fill_config.py
2 files changed, 6 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/26/11426/1

diff --git a/net/README b/net/README
index 352bc56..1d07775 100644
--- a/net/README
+++ b/net/README
@@ -71,7 +71,8 @@
 
 The fill_config.py script helps to fill the templates with the config values. Simply
 invoke fill_config.py with a dir argument (templates dir) and a file argument (specific
-config values).
+config values). The dir argument can be used in the templates with ${NET_DIR},
+temporary files (sockets etc.) should be placed inside this folder.
 
 If one or both are omitted, the script tries to re-use the most recent paths,
 they were stored in local files '.last_config' and '.last_templates'.
diff --git a/net/fill_config.py b/net/fill_config.py
index d0e2e04..c33e6b7 100755
--- a/net/fill_config.py
+++ b/net/fill_config.py
@@ -50,8 +50,9 @@
 
 local_config_file = os.path.realpath(local_config_file)
 tmpl_dir = os.path.realpath(tmpl_dir)
+net_dir = os.path.realpath(".")
 
-print('using config file %r\non templates %r' % (local_config_file, tmpl_dir))
+print('using config file %r\non templates %r\nwith NET_DIR %r' % (local_config_file, tmpl_dir, net_dir))
 
 with open(LAST_LOCAL_CONFIG_FILE, 'w') as last_file:
   last_file.write(local_config_file)
@@ -59,7 +60,8 @@
   last_file.write(tmpl_dir)
 
 # read in variable values from config file
-local_config = {}
+# NET_DIR is the folder where fill_config.py was started
+local_config = {"NET_DIR": net_dir}
 
 line_nr = 0
 for line in open(local_config_file):

-- 
To view, visit https://gerrit.osmocom.org/11426
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561
Gerrit-Change-Number: 11426
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181022/52d7e55a/attachment.htm>


More information about the gerrit-log mailing list