summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav <v.gletenko@vyos.io>2021-12-11 10:42:57 +0000
committerViacheslav <v.gletenko@vyos.io>2021-12-11 10:42:57 +0000
commit6d6aebef8225ec01a2e168355ae3bd81d07541ca (patch)
tree7cca6dddb93e97eb1a445df34259f7d752a4c1c1
parent7ebf5824def200dcbac8ebb3851fa59df405b6c0 (diff)
downloadvyatta-config-mgmt-6d6aebef8225ec01a2e168355ae3bd81d07541ca.tar.gz
vyatta-config-mgmt-6d6aebef8225ec01a2e168355ae3bd81d07541ca.zip
remote: T4029: Fix source address args for upload
-rwxr-xr-xscripts/vyatta-commit-push.pl7
1 files changed, 6 insertions, 1 deletions
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);