Skip to content

Commit

Permalink
software: Check the number of custom configs
Browse files Browse the repository at this point in the history
  • Loading branch information
ish-hcc committed Nov 18, 2024
1 parent e17ab86 commit 7ca93ce
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions lib/software/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,24 @@ func MigrateSoftware(executionID string, executionList *[]model.MigrationSoftwar
return
}

migrationLogger.Printf(INFO, "Starting to copy custom configs")
var customConfigs []ConfigFile
for _, customConfig := range strings.Split(sw.CustomConfigs, ",") {
customConfigs = append(customConfigs, ConfigFile{
Path: customConfig,
Status: "Custom",
})
}
err = copyConfigFiles(s, t, customConfigs)
if err != nil {
logger.Println(logger.ERROR, true, "migrateSoftware: ExecutionID="+executionID+
", SoftwareID="+execution.SoftwareID+", Error="+err.Error())
updateStatus(i, "failed", err.Error(), false)

return
customConfigsSplit := strings.Split(sw.CustomConfigs, ",")
if len(customConfigsSplit) > 0 {
migrationLogger.Printf(INFO, "Starting to copy custom configs")
var customConfigs []ConfigFile
for _, customConfig := range customConfigsSplit {
customConfigs = append(customConfigs, ConfigFile{
Path: customConfig,
Status: "Custom",
})
}
err = copyConfigFiles(s, t, customConfigs)
if err != nil {
logger.Println(logger.ERROR, true, "migrateSoftware: ExecutionID="+executionID+
", SoftwareID="+execution.SoftwareID+", Error="+err.Error())
updateStatus(i, "failed", err.Error(), false)

return
}
}

err = serviceMigrator(s, t, execution.SoftwareName, executionID)
Expand Down

0 comments on commit 7ca93ce

Please sign in to comment.