d
This commit is contained in:
@@ -491,7 +491,7 @@ func ImportCmToNF(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
neTypeUpper := strings.ToUpper(neType)
|
||||
//neTypeLower := strings.ToLower(neType)
|
||||
neTypeLower := strings.ToLower(neType)
|
||||
|
||||
neId := services.GetUriParamString(r, "ne_id", ",", false, false)
|
||||
|
||||
@@ -616,7 +616,12 @@ func ImportCmToNF(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
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)
|
||||
cmd := exec.Command("ssh", sshHost, unzipCmd)
|
||||
out, err := cmd.CombinedOutput()
|
||||
|
||||
Reference in New Issue
Block a user