]> git.proxmox.com Git - pve-cluster.git/commitdiff
cleanup calls to external programs
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 10 Jun 2016 09:56:45 +0000 (11:56 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 10 Jun 2016 10:35:46 +0000 (12:35 +0200)
data/PVE/pvecm

index cbd891db44b9746c91433e6434fb9ab924bc807a..612e9069e90001d192ed3782dc24049efe2f52a6 100755 (executable)
@@ -398,9 +398,9 @@ __PACKAGE__->register_method ({
        # make sure known_hosts is on local filesystem
        PVE::Cluster::ssh_unmerge_known_hosts();
 
-       my $cmd = "ssh-copy-id -i /root/.ssh/id_rsa 'root\@$host' >/dev/null 2>&1";
-       system ($cmd) == 0 ||
-           die "unable to copy ssh ID\n";
+       my $cmd = ['ssh-copy-id', '-i', '/root/.ssh/id_rsa', "root\@$host"];
+       PVE::Tools::run_command($cmd, 'outfunc' => sub {}, 'errfunc' => sub {},
+                               'errmsg' => "unable to copy ssh ID");
 
        $cmd = ['ssh', $host, '-o', 'BatchMode=yes',
                'pvecm', 'addnode', $nodename, '--force', 1];