diff options
author | James Meyer <james.meyer@operamail.com> | 2010-03-28 00:54:01 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2010-03-28 00:54:01 (GMT) |
commit | 26444d35e3ce38da0504600900d4775eb7a5970b (patch) | |
tree | eb8fafbd5ffafc980925f3a8e57c117bc8daada0 /abs/core-testing/LinHES-config/mv_common.py | |
parent | a2c0883f206547f76d207a8477afc82a07cf0a30 (diff) | |
download | linhes_pkgbuild-26444d35e3ce38da0504600900d4775eb7a5970b.zip linhes_pkgbuild-26444d35e3ce38da0504600900d4775eb7a5970b.tar.gz linhes_pkgbuild-26444d35e3ce38da0504600900d4775eb7a5970b.tar.bz2 |
linhes-systemconfig: add ability to enable or disable modules based on configfile
/etc/mythvantage.cfg is the config file
Changing any value to False will make systemconfig.py skip that module and print what section is being skipped.
closes #663
Diffstat (limited to 'abs/core-testing/LinHES-config/mv_common.py')
-rwxr-xr-x | abs/core-testing/LinHES-config/mv_common.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/abs/core-testing/LinHES-config/mv_common.py b/abs/core-testing/LinHES-config/mv_common.py index 28b53d7..0272809 100755 --- a/abs/core-testing/LinHES-config/mv_common.py +++ b/abs/core-testing/LinHES-config/mv_common.py @@ -1,9 +1,34 @@ # -*- coding: utf-8 -*- import logging, os, time import commands +import ConfigParser config_file = "mv_config" data_config = __import__(config_file, globals(), locals(), []) +module_config = ConfigParser.RawConfigParser() +try: + module_config.read('/etc/mythvantage.cfg') +except: + logging.info("couldn't read mythvantage.cfg") + + +def read_config(module_config,data): + rvalue = True + section = "mythvantage" + try: + rvalue = module_config.get(section, data) + if rvalue == "False": + rvalue = False + if rvalue == "no": + rvalue = False + + + except: + logging.debug("Couldn't read mythvantage.cfg") + rvalue = True + + return rvalue + def runcmd(cmd): if data_config.NOOPDEBUG=="FALSE": pass |