weizhouapache commented on code in PR #13281:
URL: https://github.com/apache/cloudstack/pull/13281#discussion_r4217056470


##########
python/lib/cloudutils/serviceConfig.py:
##########
@@ -519,75 +519,6 @@ def config(self):
             logging.debug(e)
             return False
 
-class securityPolicyConfigUbuntu(serviceCfgBase):
-    def __init__(self, syscfg):
-        super(securityPolicyConfigUbuntu, self).__init__(syscfg)
-        self.serviceName = "Apparmor"
-
-    def config(self):
-        try:
-            cmd = bash("service apparmor status")
-            if not cmd.isSuccess() or cmd.getStdout() == "":
-                self.spRunning = False
-                return True
-
-            if not bash("apparmor_status |grep libvirt").isSuccess():
-                return True
-
-            bash("ln -s /etc/apparmor.d/usr.sbin.libvirtd 
/etc/apparmor.d/disable/")
-            bash("ln -s /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper 
/etc/apparmor.d/disable/")
-            bash("apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd")
-            bash("apparmor_parser -R 
/etc/apparmor.d/usr.lib.libvirt.virt-aa-helper")
-
-            return True
-        except:
-            raise CloudRuntimeException("Failed to configure apparmor, please 
see the /var/log/cloudstack/agent/setup.log for detail, \
-                                        or you can manually disable it before 
starting myCloud")
-
-    def restore(self):
-        try:
-            self.syscfg.svo.enableService("apparmor")
-            self.syscfg.svo.startService("apparmor")
-            return True
-        except:
-            logging.debug(formatExceptionInfo())
-            return False
-
-class securityPolicyConfigRedhat(serviceCfgBase):
-    def __init__(self, syscfg):
-        super(securityPolicyConfigRedhat, self).__init__(syscfg)
-        self.serviceName = "SElinux"
-
-    def config(self):
-        selinuxEnabled = True
-
-        if not bash("selinuxenabled").isSuccess():
-            selinuxEnabled = False
-
-        if selinuxEnabled:
-            try:
-                bash("setenforce 0")
-                cfo = configFileOps("/etc/selinux/config", self)
-                cfo.replace_line("SELINUX=", "SELINUX=permissive")
-                return True
-            except:
-                raise CloudRuntimeException("Failed to configure selinux, 
please see the /var/log/cloudstack/agent/setup.log for detail, \
-                                            or you can manually disable it 
before starting myCloud")
-        else:
-            return True
-
-    def restore(self):
-        try:
-            bash("setenforce 1")
-            return True
-        except:
-            logging.debug(formatExceptionInfo())
-            return False
-
-class securityPolicyConfigSUSE(securityPolicyConfigRedhat):
-    pass
-
-
 def configure_libvirt_tls(tls_enabled=False, cfo=None):
     save = False
     if not cfo:

Review Comment:
   title has been updated



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to