Add context to net ns symlink removal errors

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2018-02-25 20:16:00 -08:00
parent 8ea79e755f
commit f94948d8ec

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) {