We have to add additional check to commit-archive command to prevent backtrace when network is not configured.
vyos@vyos# run show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
eth0 - u/u
eth1 - u/u
eth2 - u/u
eth3 - u/u
lo 127.0.0.1/8 u/u
::1/128
[edit]
vyos@vyos# set system config-management commit-archive location scp://vyos@vyos@192.168.255.11:/tmp/
[edit]
vyos@vyos# commit
Use of uninitialized value $source_address in concatenation (.) or string at /etc/commit/post-hooks.d/02vyatta-commit-push.pl line 78.
Archiving config...
scp://192.168.255.11:/tmp/ Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/vyos/remote.py", line 294, in upload
urlc(urlstring, *args, **kwargs).upload(local_path)
File "/usr/lib/python3/dist-packages/vyos/remote.py", line 187, in upload
with self._establish() as ssh, ssh.open_sftp() as sftp:
File "/usr/lib/python3/dist-packages/vyos/remote.py", line 174, in _establish
sock = socket.create_connection((self.hostname, self.port), socket.getdefaulttimeout(), self.source)
File "/usr/lib/python3.7/socket.py", line 727, in create_connection
raise err
File "/usr/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable