From 6d6aebef8225ec01a2e168355ae3bd81d07541ca Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Sat, 11 Dec 2021 10:42:57 +0000 Subject: remote: T4029: Fix source address args for upload --- scripts/vyatta-commit-push.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/vyatta-commit-push.pl b/scripts/vyatta-commit-push.pl index 075fefa..d5637ca 100755 --- a/scripts/vyatta-commit-push.pl +++ b/scripts/vyatta-commit-push.pl @@ -97,7 +97,12 @@ foreach my $uri (@uris) { $remote .= "$path" if defined $path; print " $remote "; - system("python3 -c 'from vyos.remote import upload; upload(\"$tmp_push_file\", \"$uri/$save_file\", source_host=$source_address)'"); + # Don't set var 'source_host' if 'source-address' not in configuration + if ($source_address eq "None") { + system("python3 -c 'from vyos.remote import upload; upload(\"$tmp_push_file\", \"$uri/$save_file\")'"); + } else { + system("python3 -c 'from vyos.remote import upload; upload(\"$tmp_push_file\", \"$uri/$save_file\", source_host=$source_address)'"); + } } move($tmp_push_file, $last_push_file); -- cgit v1.2.3