X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=ocd%2Fcli%2Fealt%2Fcmd%2Fsetup%2Fcommon.go;h=c7bfbd63ec906f99ede530eb5aeb1ce36231c78f;hb=refs%2Fchanges%2F58%2F3458%2F4;hp=e0b8468fbe0df310b9e852e46743443f0ff2af49;hpb=5011a34d8324f1458ead3734992058c60d7af761;p=ealt-edge.git diff --git a/ocd/cli/ealt/cmd/setup/common.go b/ocd/cli/ealt/cmd/setup/common.go index e0b8468..c7bfbd6 100644 --- a/ocd/cli/ealt/cmd/setup/common.go +++ b/ocd/cli/ealt/cmd/setup/common.go @@ -18,7 +18,6 @@ limitations under the License. // It returns an error if the command outputs anything on the stderr. package setup - import ( "bytes" "fmt" @@ -89,14 +88,14 @@ func (cm Command) ExecuteCmdShowOutput() error { } func runCommandAtShell(command string) (string, error) { - cmd := &Command{Cmd: exec.Command("sh", "-c", command)} - err := cmd.ExecuteCmdShowOutput() - if err != nil { - return "", err - } - errout := cmd.GetStdErr() - if errout != "" { - return "", fmt.Errorf("%s", errout) - } - return cmd.GetStdOutput(), nil + cmd := &Command{Cmd: exec.Command("sh", "-c", command)} + err := cmd.ExecuteCmdShowOutput() + if err != nil { + return "", err + } + errout := cmd.GetStdErr() + if errout != "" { + return "", fmt.Errorf("%s", errout) + } + return cmd.GetStdOutput(), nil }