Skip to content

Commit

Permalink
Fix chcon error -- Issue #640 (#658)
Browse files Browse the repository at this point in the history
* Fix Issue #534 (#576)

* Fix Issue #390, Allow 'size' in snapshot options

* Updated usage doc

* Fix issue #534 - invalid config entry creates session leak

* Fix for chcon error -- issue #640
  • Loading branch information
wdurairaj authored Jun 24, 2019
1 parent b60c315 commit 73fcc74
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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

0 comments on commit 73fcc74

Please sign in to comment.