diff options
author | Zuul <zuul@review.opendev.org> | 2023-02-01 12:56:26 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-02-01 12:56:26 +0000 |
commit | 3c248bbb89ad8fc193279bd2052ed70f919f4b8f (patch) | |
tree | 12b993daf9bff1af01df765b9a7757b65e8cba7d /ironic/drivers/modules/image_utils.py | |
parent | 68efd7970d8db84d9127284294dda895c3b382ad (diff) | |
parent | 6210cae144d3b8fad48581065f74262e5d895282 (diff) | |
download | ironic-xena-em.tar.gz |
Diffstat (limited to 'ironic/drivers/modules/image_utils.py')
-rw-r--r-- | ironic/drivers/modules/image_utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ironic/drivers/modules/image_utils.py b/ironic/drivers/modules/image_utils.py index 85834157b..424ecd37a 100644 --- a/ironic/drivers/modules/image_utils.py +++ b/ironic/drivers/modules/image_utils.py @@ -207,6 +207,16 @@ class ImageHandler(object): try: os.link(image_file, published_file) os.chmod(image_file, self._file_permission) + try: + utils.execute( + '/usr/sbin/restorecon', '-i', '-R', 'v', public_dir) + except FileNotFoundError as exc: + LOG.debug( + "Could not restore SELinux context on " + "%(public_dir)s, restorecon command not found.\n" + "Error: %(error)s", + {'public_dir': public_dir, + 'error': exc}) except OSError as exc: LOG.debug( |