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

Method config

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

Source from the content-addressed store, hash-verified

525 self.serviceName = "Apparmor"
526
527 def config(self):
528 try:
529 cmd = bash("service apparmor status")
530 if not cmd.isSuccess() or cmd.getStdout() == "":
531 self.spRunning = False
532 return True
533
534 if not bash("apparmor_status |grep libvirt").isSuccess():
535 return True
536
537 bash("ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/")
538 bash("ln -s /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper /etc/apparmor.d/disable/")
539 bash("apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd")
540 bash("apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper")
541
542 return True
543 except:
544 raise CloudRuntimeException("Failed to configure apparmor, please see the /var/log/cloudstack/agent/setup.log for detail, \
545 or you can manually disable it before starting myCloud")
546
547 def restore(self):
548 try:

Callers

nothing calls this directly

Calls 4

bashClass · 0.85
isSuccessMethod · 0.65
getStdoutMethod · 0.45

Tested by

no test coverage detected