diff options
author | Daniil Baturin <daniil@baturin.org> | 2018-05-17 06:51:44 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2018-05-17 06:51:44 +0200 |
commit | 362a791650858eea3b79e154a218630c7a4fdbea (patch) | |
tree | d30a1e9fb4c16d820a5296c6b7161eec99d4e89d /scripts/build-command-templates | |
parent | af97e7d09644cd14b7cd0c2aab42d329dcbd9ae1 (diff) | |
download | vyos-1x-362a791650858eea3b79e154a218630c7a4fdbea.tar.gz vyos-1x-362a791650858eea3b79e154a218630c7a4fdbea.zip |
T646: prevent convertors from overwriting existing node.def files.
Diffstat (limited to 'scripts/build-command-templates')
-rwxr-xr-x | scripts/build-command-templates | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/build-command-templates b/scripts/build-command-templates index a99f317d7..88223ea80 100755 --- a/scripts/build-command-templates +++ b/scripts/build-command-templates @@ -265,8 +265,13 @@ def process_node(n, tmpl_dir): props["tag"] = "True" - with open(os.path.join(make_path(my_tmpl_dir), "node.def"), "w") as f: - f.write(make_node_def(props)) + nodedef_path = os.path.join(make_path(my_tmpl_dir), "node.def") + if not os.path.exists(nodedef_path): + with open(nodedef_path, "w") as f: + f.write(make_node_def(props)) + else: + # Something has already generated that file + pass if node_type == "node": |