Browse Source

Fix plugin remove dir name after rename.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Brian Goff 8 years ago
parent
commit
4bf263c198
1 changed files with 3 additions and 2 deletions
  1. 3 2
      plugin/backend_linux.go

+ 3 - 2
plugin/backend_linux.go

@@ -630,11 +630,12 @@ func (pm *Manager) Remove(name string, config *types.PluginRmConfig) error {
 		return errors.Wrap(err, "error unmounting plugin data")
 	}
 
-	if err := os.Rename(pluginDir, pluginDir+"-removing"); err != nil {
+	removeDir := pluginDir + "-removing"
+	if err := os.Rename(pluginDir, removeDir); err != nil {
 		return errors.Wrap(err, "error performing atomic remove of plugin dir")
 	}
 
-	if err := system.EnsureRemoveAll(pluginDir); err != nil {
+	if err := system.EnsureRemoveAll(removeDir); err != nil {
 		return errors.Wrap(err, "error removing plugin dir")
 	}
 	pm.config.Store.Remove(p)