(self)
| 504 | self.serviceName = "Host" |
| 505 | |
| 506 | def config(self): |
| 507 | try: |
| 508 | cfo = configFileOps("/etc/cloudstack/agent/agent.properties", self) |
| 509 | reservedMemory = float(cfo.getEntry("host.reserved.mem.mb").strip() or 1024) |
| 510 | totalMemory = float(bash("awk '/MemTotal/ { printf \"%.3f \\n\", $2/1024 }' /proc/meminfo").getStdout().strip()) |
| 511 | if totalMemory < reservedMemory : |
| 512 | raise CloudRuntimeException("CloudStack requires more than %d MB memory since %d MB is reserved" %(reservedMemory, reservedMemory)) |
| 513 | |
| 514 | if int(bash('ip a | grep "^\\w" | grep -iv "^lo" | wc -l').getStdout()) < 1 : |
| 515 | raise CloudRuntimeException("CloudStack requires at least a single NIC") |
| 516 | |
| 517 | return True |
| 518 | except Exception as e: |
| 519 | logging.debug(e) |
| 520 | return False |
| 521 | |
| 522 | class securityPolicyConfigUbuntu(serviceCfgBase): |
| 523 | def __init__(self, syscfg): |
nothing calls this directly
no test coverage detected