Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix chcon error -- Issue #640 #658

Merged
merged 4 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion hpedockerplugin/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,11 @@ def mount_share(self, share_name, share, mount_id):

self._create_mount_dir(mount_dir)
LOG.info("Mounting share path %s to %s" % (share_path, mount_dir))
sh.mount('-t', 'nfs', share_path, mount_dir)
if utils.is_host_os_rhel():
sh.mount('-o', 'context="system_u:object_r:nfs_t:s0"',
'-t', 'nfs', share_path, mount_dir)
else:
sh.mount('-t', 'nfs', share_path, mount_dir)
LOG.debug('Device: %(path)s successfully mounted on %(mount)s',
{'path': share_path, 'mount': mount_dir})

Expand Down
9 changes: 9 additions & 0 deletions hpedockerplugin/hpe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import six
import string
import uuid
import platform

from Crypto.Cipher import AES
from Crypto.Random import random
Expand Down Expand Up @@ -156,6 +157,14 @@ def get_remote3par_rcg_name(id, array_id):
six.text_type(array_id))


def is_host_os_rhel():
platform_type = list(platform.linux_distribution())
if 'Red Hat Enterprise Linux Server' in platform_type:
return True
else:
return False


class PasswordDecryptor(object):
def __init__(self, backend_name, etcd):
self._backend_name = backend_name
Expand Down