1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

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

View File

@@ -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
}