summaryrefslogtreecommitdiff
path: root/src/helpers/vyos-save-config.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-09-08 07:33:22 +0200
committerGitHub <noreply@github.com>2023-09-08 07:33:22 +0200
commitbf287c6ef35fea6d4deb04c88c56a99e9768d36d (patch)
tree8b2705dd5f5958e2c293bc59bf85ba416e1577a8 /src/helpers/vyos-save-config.py
parent0fcf2cbcfcabdd98bff48f1d92ee4006a73de43c (diff)
parent302c264ece7dfae89e16e98ef5d901c7172a4919 (diff)
downloadvyos-1x-bf287c6ef35fea6d4deb04c88c56a99e9768d36d.tar.gz
vyos-1x-bf287c6ef35fea6d4deb04c88c56a99e9768d36d.zip
Merge pull request #2207 from jestabro/T5551-sagitta
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())