Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Commit

Permalink
Handles exception when restorecon is called with SELinux disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkliban committed Nov 14, 2016
1 parent e30ee8a commit 9e76745
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/pulp/plugins/util/publish_step.py
Expand Up @@ -902,7 +902,11 @@ def process_main(self, item=None):

try:
os.rename(self.source_dir, timestamp_master_dir)
selinux.restorecon(timestamp_master_dir.encode('utf-8'), recursive=True)
try:
selinux.restorecon(timestamp_master_dir.encode('utf-8'), recursive=True)
except OSError as e:
if e.errno != errno.EPERM:
raise
except OSError as e:
if e.errno == errno.EXDEV:
copytree(self.source_dir, timestamp_master_dir, symlinks=True)
Expand Down

0 comments on commit 9e76745

Please sign in to comment.