fix: active pkg issue
This commit is contained in:
@@ -701,7 +701,18 @@ func ActiveSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
runCmd := fmt.Sprintf("sudo %s/actpkg.sh '%s'",
|
runCmd := fmt.Sprintf("sudo %s/actpkg.sh '%s'",
|
||||||
config.GetYamlConfig().NE.ScpDir, filePath)
|
config.GetYamlConfig().NE.ScpDir, filePath)
|
||||||
if neTypeLower == "omc" {
|
if neTypeLower == "omc" {
|
||||||
services.ResponseStatusOK201Accepted(w)
|
idNeVersion, _ := strconv.Atoi((*neVersion)[0]["id"])
|
||||||
|
neVersionData := dborm.NeVersion{
|
||||||
|
Status: SoftwareStatusActive,
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = dborm.XormUpdateTableById(idNeVersion, "ne_version", neVersionData)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Faile to UpdateTableById:", err)
|
||||||
|
services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
services.ResponseStatusOK204NoContent(w)
|
||||||
RunSSHCmd(sshHost, runCmd)
|
RunSSHCmd(sshHost, runCmd)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -889,7 +900,24 @@ func RollBackSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
runCmd := fmt.Sprintf("sudo %s/rbkpkg.sh '%s'",
|
runCmd := fmt.Sprintf("sudo %s/rbkpkg.sh '%s'",
|
||||||
config.GetYamlConfig().NE.ScpDir, filePath)
|
config.GetYamlConfig().NE.ScpDir, filePath)
|
||||||
if neTypeLower == "omc" {
|
if neTypeLower == "omc" {
|
||||||
services.ResponseStatusOK201Accepted(w)
|
idNeVersion, _ := strconv.Atoi((*neVersion)[0]["id"])
|
||||||
|
neVersionData := dborm.NeVersion{
|
||||||
|
Version: (*neVersion)[0]["pre_version"],
|
||||||
|
FilePath: (*neVersion)[0]["pre_file"],
|
||||||
|
PreVersion: "-",
|
||||||
|
PreFile: "-",
|
||||||
|
NewVersion: (*neVersion)[0]["version"],
|
||||||
|
NewFile: (*neVersion)[0]["file_path"],
|
||||||
|
Status: SoftwareStatusActive,
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = dborm.XormUpdateTableById(idNeVersion, "ne_version", neVersionData)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Faile to UpdateTableById:", err)
|
||||||
|
services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
services.ResponseStatusOK204NoContent(w)
|
||||||
RunSSHCmd(sshHost, runCmd)
|
RunSSHCmd(sshHost, runCmd)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user