MCPcopy Create free account
hub / github.com/apache/cloudstack / config

Method config

python/lib/cloudutils/serviceConfig.py:561–577  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

559 self.serviceName = "SElinux"
560
561 def config(self):
562 selinuxEnabled = True
563
564 if not bash("selinuxenabled").isSuccess():
565 selinuxEnabled = False
566
567 if selinuxEnabled:
568 try:
569 bash("setenforce 0")
570 cfo = configFileOps("/etc/selinux/config", self)
571 cfo.replace_line("SELINUX=", "SELINUX=permissive")
572 return True
573 except:
574 raise CloudRuntimeException("Failed to configure selinux, please see the /var/log/cloudstack/agent/setup.log for detail, \
575 or you can manually disable it before starting myCloud")
576 else:
577 return True
578
579 def restore(self):
580 try:

Callers

nothing calls this directly

Calls 5

configFileOpsClass · 0.90
bashClass · 0.85
isSuccessMethod · 0.65
replace_lineMethod · 0.45

Tested by

no test coverage detected