relay ovftool output.
This commit is contained in:
parent
449da83896
commit
0cf0a4336d
|
@ -1,10 +1,10 @@
|
||||||
package vsphere
|
package vsphere
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
@ -135,13 +135,16 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
|
||||||
password,
|
password,
|
||||||
"<password>",
|
"<password>",
|
||||||
-1))
|
-1))
|
||||||
|
|
||||||
|
var out bytes.Buffer
|
||||||
cmd := exec.Command("ovftool", args...)
|
cmd := exec.Command("ovftool", args...)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = &out
|
||||||
cmd.Stderr = os.Stderr
|
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
return nil, false, fmt.Errorf("Failed: %s\n", err)
|
return nil, false, fmt.Errorf("Failed: %s\n%s\n", err, out.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui.Message(out.String())
|
||||||
|
|
||||||
return artifact, false, nil
|
return artifact, false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue