fix: omc upgrade and restart issue
This commit is contained in:
@@ -858,15 +858,19 @@ func PostNeServiceAction(w http.ResponseWriter, r *http.Request) {
|
|||||||
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
||||||
switch neTypeLower {
|
switch neTypeLower {
|
||||||
case "omc":
|
case "omc":
|
||||||
|
// send 204 to fe firstly
|
||||||
|
services.ResponseStatusOK204NoContent(w)
|
||||||
actionCmd := fmt.Sprintf("sudo %s/bin/omcsvc.sh %s", config.GetYamlConfig().NE.OmcDir, action)
|
actionCmd := fmt.Sprintf("sudo %s/bin/omcsvc.sh %s", config.GetYamlConfig().NE.OmcDir, action)
|
||||||
cmd := exec.Command("ssh", sshHost, actionCmd)
|
go RunSSHCmd(sshHost, actionCmd)
|
||||||
out, err := cmd.CombinedOutput()
|
return
|
||||||
log.Debugf("Exec output: %v", string(out))
|
// cmd := exec.Command("ssh", sshHost, actionCmd)
|
||||||
if err != nil {
|
// out, err := cmd.CombinedOutput()
|
||||||
log.Errorf("Faile to execute ssh %s omc:%v", action, err)
|
// log.Debugf("Exec output: %v", string(out))
|
||||||
services.ResponseInternalServerError500ProcessError(w, err)
|
// if err != nil {
|
||||||
return
|
// log.Errorf("Faile to execute ssh %s omc:%v", action, err)
|
||||||
}
|
// services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
case "ims":
|
case "ims":
|
||||||
switch action {
|
switch action {
|
||||||
case "start", "stop":
|
case "start", "stop":
|
||||||
|
|||||||
@@ -930,7 +930,7 @@ func RollBackSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
services.ResponseStatusOK204NoContent(w)
|
services.ResponseStatusOK204NoContent(w)
|
||||||
RunSSHCmd(sshHost, runCmd)
|
go RunSSHCmd(sshHost, runCmd)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = RunSSHCmd(sshHost, runCmd)
|
err = RunSSHCmd(sshHost, runCmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user