d
This commit is contained in:
@@ -525,11 +525,11 @@ udm:
|
|||||||
display: "Context Identifier"
|
display: "Context Identifier"
|
||||||
comment: ""
|
comment: ""
|
||||||
- name: "vplmnDynamicAddressAllowed"
|
- name: "vplmnDynamicAddressAllowed"
|
||||||
type: "enum"
|
type: "bool"
|
||||||
value: '0'
|
value: 'true'
|
||||||
access: "read-write"
|
access: "read-write"
|
||||||
filter: "{\"0\":\"Not Allowed\",\"1\":\"Allowed\"}"
|
filter: 'false;true;'
|
||||||
display: "Vplmn Dynamic Address Allowed"
|
display: "enable"
|
||||||
comment: ""
|
comment: ""
|
||||||
- name: "pdnGWAllocationType"
|
- name: "pdnGWAllocationType"
|
||||||
type: "enum"
|
type: "enum"
|
||||||
|
|||||||
@@ -539,12 +539,12 @@ func DistributeSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
log.Debug("neVersion:", neVersion)
|
log.Debug("neVersion:", neVersion)
|
||||||
|
|
||||||
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip)
|
||||||
mkdirCmd := fmt.Sprintf("mkdir -p %s/software/%s", config.GetYamlConfig().NE.OmcDir, neTypeLower)
|
mkdirCmd := fmt.Sprintf("sudo mkdir -p %s/software/%s", config.GetYamlConfig().NE.OmcDir, neTypeLower)
|
||||||
cmd := exec.Command("ssh", sshHost, mkdirCmd)
|
cmd := exec.Command("ssh", sshHost, mkdirCmd)
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
log.Tracef("Exec output: %v", string(out))
|
log.Tracef("Exec output: %v", string(out))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Faile to exec cmd:", err)
|
log.Error("Faile to mkdir:", err)
|
||||||
services.ResponseInternalServerError500ProcessError(w, err)
|
services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -552,9 +552,10 @@ func DistributeSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
fileName := (*neSoftware)[0]["file_name"]
|
fileName := (*neSoftware)[0]["file_name"]
|
||||||
path := (*neSoftware)[0]["path"]
|
path := (*neSoftware)[0]["path"]
|
||||||
srcFile := fmt.Sprintf("%s/%s", path, fileName)
|
srcFile := fmt.Sprintf("%s/%s", path, fileName)
|
||||||
dstDir := fmt.Sprintf("%s@%s:%s/software/%s", config.GetYamlConfig().NE.User,
|
|
||||||
neInfo.Ip, config.GetYamlConfig().NE.OmcDir, neTypeLower)
|
scpDir := fmt.Sprintf("%s@%s:%s", config.GetYamlConfig().NE.User,
|
||||||
cmd = exec.Command("scp", "-r", srcFile, dstDir)
|
neInfo.Ip, config.GetYamlConfig().NE.ScpDir)
|
||||||
|
cmd = exec.Command("scp", "-r", srcFile, scpDir)
|
||||||
out, err = cmd.CombinedOutput()
|
out, err = cmd.CombinedOutput()
|
||||||
log.Tracef("Exec output: %v", string(out))
|
log.Tracef("Exec output: %v", string(out))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -562,6 +563,17 @@ func DistributeSoftwareToNF(w http.ResponseWriter, r *http.Request) {
|
|||||||
services.ResponseInternalServerError500ProcessError(w, err)
|
services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
neFilePath := config.GetYamlConfig().NE.ScpDir + "/" + fileName
|
||||||
|
cpCmd := fmt.Sprintf("sudo cp -f %s %s/software/%s", neFilePath,
|
||||||
|
config.GetYamlConfig().NE.OmcDir, neTypeLower)
|
||||||
|
cmd = exec.Command("ssh", sshHost, cpCmd)
|
||||||
|
out, err = cmd.CombinedOutput()
|
||||||
|
log.Tracef("Exec output: %v", string(out))
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Faile to execute cp command:", err)
|
||||||
|
services.ResponseInternalServerError500ProcessError(w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if len(*neVersion) == 0 {
|
if len(*neVersion) == 0 {
|
||||||
neVersionData := dborm.NeVersion{
|
neVersionData := dborm.NeVersion{
|
||||||
|
|||||||
Reference in New Issue
Block a user