[pve-devel] [PATCH cluster] add sshinfo_to_command_base

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Jun 6 10:03:57 CEST 2017


required for rsync's --rsh
---
 data/PVE/Cluster.pm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/data/PVE/Cluster.pm b/data/PVE/Cluster.pm
index 731acc5..05897ed 100644
--- a/data/PVE/Cluster.pm
+++ b/data/PVE/Cluster.pm
@@ -1877,15 +1877,21 @@ sub get_ssh_info {
     };
 }
 
-sub ssh_info_to_command {
+sub ssh_info_to_command_base {
     my ($info, @extra_options) = @_;
     return [
 	'/usr/bin/ssh',
 	'-o', 'BatchMode=yes',
 	'-o', 'HostKeyAlias='.$info->{name},
-	@extra_options,
-	"root\@$info->{ip}"
+	@extra_options
     ];
 }
 
+sub ssh_info_to_command {
+    my ($info, @extra_options) = @_;
+    my $cmd = ssh_info_to_command_base($info, @extra_options);
+    push @$cmd, "root\@$info->{ip}";
+    return $cmd;
+}
+
 1;
-- 
2.11.0





More information about the pve-devel mailing list