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

Method config

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

Source from the content-addressed store, hash-verified

436 self.serviceName = "Cgroup"
437
438 def config(self):
439 try:
440 cfo = configFileOps("/etc/cgconfig.conf", self)
441 addConfig = "group virt {\n \
442 cpu {\n \
443 cpu.shares = 9216;\n \
444 }\n \
445 }\n"
446 cfo.add_lines(addConfig)
447
448 self.syscfg.svo.stopService("cgconfig", True)
449 self.syscfg.svo.enableService("cgconfig",forcestart=True)
450
451 cfo = configFileOps("/etc/cgrules.conf", self)
452 cfgline = "root:/usr/sbin/libvirtd cpu virt/\n"
453 cfo.add_lines(cfgline)
454
455 self.syscfg.svo.stopService("cgred", True)
456 if not self.syscfg.svo.enableService("cgred"):
457 return False
458 return True
459 except:
460 raise
461
462 def restore(self):
463 try:

Callers

nothing calls this directly

Calls 4

configFileOpsClass · 0.90
enableServiceMethod · 0.65
add_linesMethod · 0.45
stopServiceMethod · 0.45

Tested by

no test coverage detected