From 807167660134ef5c459998e880ea8a54ef389781 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 29 Apr 2014 23:19:21 -0600 Subject: [PATCH] Update pkg/apparmor to provide a better error message when apparmor_parser cannot be found Docker-DCO-1.1-Signed-off-by: Andrew Page (github: tianon) --- apparmor/setup.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/apparmor/setup.go b/apparmor/setup.go index 2401f63..ef6333a 100644 --- a/apparmor/setup.go +++ b/apparmor/setup.go @@ -69,15 +69,8 @@ func InstallDefaultProfile(backupPath string) error { cmd.Dir = "/etc/apparmor.d" output, err := cmd.CombinedOutput() - if err != nil && !os.IsNotExist(err) { - if e, ok := err.(*exec.Error); ok { - // keeping with the current profile load code, if the parser does not - // exist then just return - if e.Err == exec.ErrNotFound || os.IsNotExist(e.Err) { - return nil - } - } - return fmt.Errorf("Error loading docker profile: %s (%s)", err, output) + if err != nil { + return fmt.Errorf("Error loading docker apparmor profile: %s (%s)", err, output) } return nil }