Fix VM usage and update ex/runvm
[gruntmaster-daemon.git] / lib / Gruntmaster / Daemon / Format.pm
index 4a57d6a..7b6f77b 100644 (file)
@@ -29,8 +29,10 @@ sub runvm {
        my $cmd = $ENV{GRUNTMASTER_VM};
        $cmd .= ' ' . $arg if $arg;
        get_logger->trace("Starting VM $name ($cmd)");
-       $vm{$name} = Expect->spawn($cmd);
+       $vm{$name} = Expect->new;
        $vm{$name}->raw_pty(1);
+       $vm{$name}->log_stdout(0);
+       $vm{$name}->spawn($cmd);
        $vm{$name}->expect(5, '# ') or get_logger->logdie("Error while starting VM $name: ". $vm{$name}->error);
 }
 
@@ -66,7 +68,7 @@ sub execlist {
        if ($vm{$vm}) {
                my $cmd = ">$er " . shell_quote 'gruntmaster-exec', @args;
                get_logger->trace("Running in VM $vm: $cmd");
-               $vm{$vm}->send($cmd);
+               $vm{$vm}->send($cmd, "\n");
        } else {
                $pid{$vm} = fork // die "Cannot fork\n";
                unless ($pid{$vm}) {
This page took 0.021566 seconds and 4 git commands to generate.