d
This commit is contained in:
@@ -491,7 +491,7 @@ func ImportCmToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
neTypeUpper := strings.ToUpper(neType)
|
neTypeUpper := strings.ToUpper(neType)
|
||||||
//neTypeLower := strings.ToLower(neType)
|
neTypeLower := strings.ToLower(neType)
|
||||||
|
|
||||||
neId := services.GetUriParamString(r, "ne_id", ",", false, false)
|
neId := services.GetUriParamString(r, "ne_id", ",", false, false)
|
||||||
|
|
||||||
@@ -616,7 +616,12 @@ func ImportCmToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
neFilePath := config.GetYamlConfig().NE.ScpDir + "/" + fileName
|
neFilePath := config.GetYamlConfig().NE.ScpDir + "/" + fileName
|
||||||
unzipCmd := fmt.Sprintf("sudo unzip -o %s -d %s", neFilePath, config.GetYamlConfig().NE.EtcDir)
|
var unzipCmd string
|
||||||
|
if neTypeLower != "omc" {
|
||||||
|
unzipCmd = fmt.Sprintf("sudo unzip -o %s -d %s", neFilePath, config.GetYamlConfig().NE.EtcDir)
|
||||||
|
} else {
|
||||||
|
unzipCmd = fmt.Sprintf("sudo unzip -oj %s -d %s/etc", neFilePath, config.GetYamlConfig().NE.OmcDir)
|
||||||
|
}
|
||||||
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
||||||
cmd := exec.Command("ssh", sshHost, unzipCmd)
|
cmd := exec.Command("ssh", sshHost, unzipCmd)
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
|
|||||||
Reference in New Issue
Block a user