Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit f8ce202

Browse files
authored
Merge pull request #157 from resouer/hyperhq-master-vol
Omit error if dir invalid
2 parents 92275ad + d52c045 commit f8ce202

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/volume/cinder/cinder.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ func (c *cinderVolumeUnmounter) TearDown() error {
419419
func (c *cinderVolumeUnmounter) TearDownAt(dir string) error {
420420
glog.V(5).Infof("Cinder TearDown of %s", dir)
421421

422+
if _, err := os.Stat(dir); os.IsNotExist(err) {
423+
// non-exist dir for TearDown is meaningless and it is possible that this dir has been cleaned up, just omit the error for now
424+
glog.Warningf("Volume directory: %v does not exists, it may have been cleaned up by previous tear down task", dir)
425+
return nil
426+
}
427+
422428
notmnt, err := c.mounter.IsLikelyNotMountPoint(dir)
423429
if err != nil {
424430
glog.V(4).Infof("IsLikelyNotMountPoint check failed: %v", err)

0 commit comments

Comments
 (0)