From a1a9baf926ff8ec2bd7ba0dd39cf3a9eb5fab1d3 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) --- pkg/apparmor/setup.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/apparmor/setup.go b/pkg/apparmor/setup.go index 2401f63414..ef6333a01a 100644 --- a/pkg/apparmor/setup.go +++ b/pkg/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 }