d
This commit is contained in:
@@ -666,7 +666,7 @@ func ActiveSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
log.Debug("neVersion:", neVersion)
|
||||
|
||||
if config.GetYamlConfig().OMC.TestMode == false {
|
||||
if !config.GetYamlConfig().OMC.TestMode {
|
||||
filePath := (*neVersion)[0]["file_path"]
|
||||
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
||||
rpmCmd := fmt.Sprintf("sudo rpm -Uvh '%s'", filePath)
|
||||
@@ -680,7 +680,7 @@ func ActiveSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
idNeVersion, err := strconv.Atoi((*neVersion)[0]["id"])
|
||||
idNeVersion, _ := strconv.Atoi((*neVersion)[0]["id"])
|
||||
neVersionData := dborm.NeVersion{
|
||||
Status: SoftwareStatusActive,
|
||||
}
|
||||
@@ -693,7 +693,6 @@ func ActiveSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
services.ResponseStatusOK204NoContent(w)
|
||||
return
|
||||
}
|
||||
|
||||
func RollBackSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -758,7 +757,7 @@ func RollBackSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if config.GetYamlConfig().OMC.TestMode == false {
|
||||
if !config.GetYamlConfig().OMC.TestMode {
|
||||
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
||||
rpmCmd := fmt.Sprintf("rpm -Uvh --oldpackage '%s'", filePath)
|
||||
cmd := exec.Command("ssh", sshHost, rpmCmd)
|
||||
@@ -771,7 +770,7 @@ func RollBackSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
idNeVersion, err := strconv.Atoi((*neVersion)[0]["id"])
|
||||
idNeVersion, _ := strconv.Atoi((*neVersion)[0]["id"])
|
||||
neVersionData := dborm.NeVersion{
|
||||
Version: (*neVersion)[0]["pre_version"],
|
||||
FilePath: (*neVersion)[0]["pre_file"],
|
||||
@@ -790,5 +789,4 @@ func RollBackSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
services.ResponseStatusOK204NoContent(w)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user