[node-patches] Change in ovirt-node[master]: edit-node: Catch the OSError when Set "SELinux" disabled

hadong0720 at gmail.com hadong0720 at gmail.com
Mon Jun 17 07:50:45 UTC 2013


hadong has uploaded a new change for review.

Change subject: edit-node: Catch the OSError when Set "SELinux" disabled
......................................................................

edit-node: Catch the OSError when Set "SELinux" disabled

Previously when the state of SELinux is disabled on the system,
edit-node will show an OSError exception.
Now edit-node catch this exception

Change-Id: Ibf65d5d8bb53152f5465baedf9db7584e4ecaefa
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=974934
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M tools/edit-node
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/86/15786/1

diff --git a/tools/edit-node b/tools/edit-node
index b9b1508..db9c662 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -1585,10 +1585,13 @@
             selinux_enforcing = None
             failed = False
             try:
-                if selinux.security_getenforce():
-                    print "Setting SELinux Permissive During Yum Install"
-                    selinux_enforcing = True
-                    selinux.security_setenforce(0)
+                try:
+                    if selinux.security_getenforce():
+                        print "Setting SELinux Permissive During Yum Install"
+                        selinux_enforcing = True
+                        selinux.security_setenforce(0)
+                except OSError:
+                    print "Warning: the state of SELinux is disabled"
                 if options.install:
                     print "Installing Packages"
                     if not editor._install_pkgs(options):


-- 
To view, visit http://gerrit.ovirt.org/15786
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf65d5d8bb53152f5465baedf9db7584e4ecaefa
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list