Skip to content

Commit

Permalink
Adds exception handling for when SELinux is disabled on EL7
Browse files Browse the repository at this point in the history
On EL7, restorecon calls out to lgetfilecon which raises an exception when
SELinux security context labels are not available.

https://www.gnu.org/software/gnulib/manual/html_node/lgetfilecon.html

closes #2439
https://pulp.plan.io/issues/2439
  • Loading branch information
dkliban committed Nov 23, 2016
1 parent 676862c commit 15d3205
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/pulp/plugins/util/publish_step.py
Expand Up @@ -905,7 +905,7 @@ def process_main(self, item=None):
try:
selinux.restorecon(timestamp_master_dir.encode('utf-8'), recursive=True)
except OSError as e:
if e.errno != errno.EPERM:
if e.errno not in [errno.EPERM, errno.ENODATA]:
raise
except OSError as e:
if e.errno == errno.EXDEV:
Expand Down

0 comments on commit 15d3205

Please sign in to comment.