mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix(glance): image can't removed when size is 0
This commit is contained in:
@@ -1171,9 +1171,12 @@ func (self *SImage) Remove() error {
|
||||
for i := 0; i < len(subimgs); i += 1 {
|
||||
err := subimgs[i].RemoveFiles()
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrapf(err, "remove subimg %s", subimgs[i].GetName())
|
||||
}
|
||||
}
|
||||
if self.Location == "" {
|
||||
return nil
|
||||
}
|
||||
if strings.HasPrefix(self.Location, LocalFilePrefix) {
|
||||
return self.RemoveFile()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user