parent
229c9b7ee9
commit
4835945839
|
@ -115,20 +115,17 @@ func DeleteProfiles(profiles []*pkg_config.Profile) []error {
|
||||||
for _, profile := range profiles {
|
for _, profile := range profiles {
|
||||||
err := deleteProfile(profile)
|
err := deleteProfile(profile)
|
||||||
|
|
||||||
var mm *cluster.Machine
|
|
||||||
var loadErr error
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mm, loadErr = cluster.LoadMachine(profile.Name)
|
mm, loadErr := cluster.LoadMachine(profile.Name)
|
||||||
}
|
|
||||||
|
|
||||||
if (err != nil && !profile.IsValid()) || (loadErr != nil || !mm.IsValid()) {
|
if !profile.IsValid() || (loadErr != nil || !mm.IsValid()) {
|
||||||
invalidProfileDeletionErrs := deleteInvalidProfile(profile)
|
invalidProfileDeletionErrs := deleteInvalidProfile(profile)
|
||||||
if len(invalidProfileDeletionErrs) > 0 {
|
if len(invalidProfileDeletionErrs) > 0 {
|
||||||
errs = append(errs, invalidProfileDeletionErrs...)
|
errs = append(errs, invalidProfileDeletionErrs...)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
errs = append(errs, err)
|
||||||
}
|
}
|
||||||
} else if err != nil {
|
|
||||||
errs = append(errs, err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errs
|
return errs
|
||||||
|
|
Loading…
Reference in New Issue