Merge pull request #5498 from tianon/better-apparmor-missing-error

This commit is contained in:
Michael Crosby 2014-04-30 15:16:43 -07:00
commit 039b08e945

View file

@ -69,15 +69,8 @@ func InstallDefaultProfile(backupPath string) error {
cmd.Dir = "/etc/apparmor.d" cmd.Dir = "/etc/apparmor.d"
output, err := cmd.CombinedOutput() output, err := cmd.CombinedOutput()
if err != nil && !os.IsNotExist(err) { if err != nil {
if e, ok := err.(*exec.Error); ok { return fmt.Errorf("Error loading docker apparmor profile: %s (%s)", err, output)
// 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)
} }
return nil return nil
} }