summaryrefslogtreecommitdiff
path: root/src/helpers/vyos-save-config.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-09-05 13:03:21 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-09-05 13:03:21 -0500
commit3fe5482a29042c92298d3e69d90c0c38404d2fcc (patch)
tree8288d95e16575ff8595a9cd54add91dbdfa168df /src/helpers/vyos-save-config.py
parent0c8823c0021d45a791ef95eaca1516b900d8cb68 (diff)
downloadvyos-1x-3fe5482a29042c92298d3e69d90c0c38404d2fcc.tar.gz
vyos-1x-3fe5482a29042c92298d3e69d90c0c38404d2fcc.zip
save-config: T5551: check if None before write, as is the case at boot
Diffstat (limited to 'src/helpers/vyos-save-config.py')
-rwxr-xr-xsrc/helpers/vyos-save-config.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/helpers/vyos-save-config.py b/src/helpers/vyos-save-config.py
index 2812155e8..8af4a7916 100755
--- a/src/helpers/vyos-save-config.py
+++ b/src/helpers/vyos-save-config.py
@@ -44,7 +44,10 @@ ct = config.get_config_tree(effective=True)
write_file = save_file if remote_save is None else NamedTemporaryFile(delete=False).name
with open(write_file, 'w') as f:
- f.write(ct.to_string())
+ # config_tree is None before boot configuration is complete;
+ # automated saves should check boot_configuration_complete
+ if ct is not None:
+ f.write(ct.to_string())
f.write("\n")
f.write(system_footer())