Change in osmo-dev[master]: fill_config.py: add NET_DIR variable
Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/11426 ) Change subject: fill_config.py: add NET_DIR variable .. Patch Set 1: Verified+1 -- 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: comment Gerrit-Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561 Gerrit-Change-Number: 11426 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 31 Oct 2018 13:06:57 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-dev[master]: fill_config.py: add NET_DIR variable
Neels Hofmeyr has submitted this change and it was merged. ( 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(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified 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: merged Gerrit-Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561 Gerrit-Change-Number: 11426 Gerrit-PatchSet: 2 Gerrit-Owner: osmith Gerrit-Reviewer: Neels Hofmeyr
Change in osmo-dev[master]: fill_config.py: add NET_DIR variable
Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/11426 ) Change subject: fill_config.py: add NET_DIR variable .. Patch Set 1: Code-Review+2 -- 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: comment Gerrit-Change-Id: Idbdf478ebb9f0b2fcd860e5eff3c414a0a459561 Gerrit-Change-Number: 11426 Gerrit-PatchSet: 1 Gerrit-Owner: osmith Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 31 Oct 2018 13:06:42 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-dev[master]: fill_config.py: add NET_DIR variable
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