[PATCH 5/5] remove Security class
Brian C. Lane
bcl at redhat.com
Wed Aug 8 21:49:06 UTC 2012
From: "Brian C. Lane" <bcl at redhat.com>
---
pyanaconda/__init__.py | 4 +--
pyanaconda/security.py | 63 ------------------------------------------------
2 files changed, 1 insertions(+), 66 deletions(-)
delete mode 100644 pyanaconda/security.py
diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index cf40ccd..f45ec4a 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -43,7 +43,7 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
class Anaconda(object):
def __init__(self):
- import desktop, firewall, security
+ import desktop, firewall
import system_config_keyboard.keyboard as keyboard
from flags import flags
@@ -75,7 +75,6 @@ class Anaconda(object):
self.rescue = False
self.rescue_mount = True
self.rootParts = None
- self.security = security.Security()
self.simpleFilter = not iutil.isS390()
self.stage2 = None
self._storage = None
@@ -274,5 +273,4 @@ class Anaconda(object):
network.disableNMForStorageDevices(self.storage)
network.autostartFCoEDevices(self.storage)
self.desktop.write()
- self.security.write()
self.firewall.write()
diff --git a/pyanaconda/security.py b/pyanaconda/security.py
deleted file mode 100644
index 2e95323..0000000
--- a/pyanaconda/security.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# security.py - security install data and installation
-#
-# Copyright (C) 2004 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author(s): Jeremy Katz <katzj at redhat.com>
-#
-
-import iutil
-from flags import flags
-from pyanaconda.constants import ROOT_PATH
-from pykickstart.constants import *
-
-import logging
-log = logging.getLogger("anaconda")
-
-selinux_states = { SELINUX_DISABLED: "disabled",
- SELINUX_ENFORCING: "enforcing",
- SELINUX_PERMISSIVE: "permissive" }
-
-class Security:
- def __init__(self):
- if flags.selinux == 1:
- self.selinux = SELINUX_ENFORCING
- else:
- self.selinux = SELINUX_DISABLED
-
- def setSELinux(self, val):
- if not selinux_states.has_key(val):
- log.error("Tried to set to invalid SELinux state: %s" %(val,))
- val = SELINUX_DISABLED
-
- self.selinux = val
-
- def getSELinux(self):
- return self.selinux
-
- def write(self):
- args = []
-
- if not selinux_states.has_key(self.selinux):
- log.error("unknown selinux state: %s" %(self.selinux,))
- return
-
- try:
- iutil.execWithRedirect("/usr/sbin/lokkit", args,
- root=ROOT_PATH, stdout="/dev/null",
- stderr="/dev/null")
- except (RuntimeError, OSError) as msg:
- log.error ("lokkit run failed: %s" %(msg,))
--
1.7.7.6
More information about the anaconda-patches
mailing list