Merge pull request #1377 from mrunalp/sym_context_master

Add context to net ns symlink removal errors
This commit is contained in:
Daniel J Walsh 2018-03-02 17:06:18 -05:00 committed by GitHub
commit a5c3e05f9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,10 +59,14 @@ func (ns *NetNs) symlinkCreate(name string) error {
func (ns *NetNs) symlinkRemove() error {
if err := ns.symlink.Close(); err != nil {
return err
return fmt.Errorf("failed to close net ns symlink: %v", err)
}
return os.RemoveAll(ns.symlink.Name())
if err := os.RemoveAll(ns.symlink.Name()); err != nil {
return fmt.Errorf("failed to remove net ns symlink: %v", err)
}
return nil
}
func isSymbolicLink(path string) (bool, error) {