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

Commit

Permalink
Omit error if dir invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Zhang committed Dec 5, 2016
1 parent 92275ad commit d52c045
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/volume/cinder/cinder.go
Expand Up @@ -419,6 +419,12 @@ func (c *cinderVolumeUnmounter) TearDown() error {
func (c *cinderVolumeUnmounter) TearDownAt(dir string) error {
glog.V(5).Infof("Cinder TearDown of %s", dir)

if _, err := os.Stat(dir); os.IsNotExist(err) {
// non-exist dir for TearDown is meaningless and it is possible that this dir has been cleaned up, just omit the error for now
glog.Warningf("Volume directory: %v does not exists, it may have been cleaned up by previous tear down task", dir)
return nil
}

notmnt, err := c.mounter.IsLikelyNotMountPoint(dir)
if err != nil {
glog.V(4).Infof("IsLikelyNotMountPoint check failed: %v", err)
Expand Down

0 comments on commit d52c045

Please sign in to comment.