(self)
| 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: |
nothing calls this directly
no test coverage detected