summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_common.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2011-12-07 19:31:23 (GMT)
committerJames Meyer <james.meyer@operamail.com>2011-12-07 19:31:23 (GMT)
commiteb5fd1b1e7dfc1e909e0f941bb7717bd6d9271a3 (patch)
tree73a81b02c746dfb2c24058e61d6ce752b226c1b7 /abs/core/LinHES-config/mv_common.py
parent711e8aa3f3b8ee301550227b285ee3593e304564 (diff)
downloadlinhes_pkgbuild-eb5fd1b1e7dfc1e909e0f941bb7717bd6d9271a3.zip
linhes_pkgbuild-eb5fd1b1e7dfc1e909e0f941bb7717bd6d9271a3.tar.gz
linhes_pkgbuild-eb5fd1b1e7dfc1e909e0f941bb7717bd6d9271a3.tar.bz2
LinHES-config: - Add ability to poll the MBE to see if xymon & fun is supported.
- If a new feature is supported, install the client - Create config.xml in /usr/share/mythtv and symlink it into mythtv home dir. - setup a network enabled rsyslog - For new installs fix fstab to include ACL's
Diffstat (limited to 'abs/core/LinHES-config/mv_common.py')
-rwxr-xr-xabs/core/LinHES-config/mv_common.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/abs/core/LinHES-config/mv_common.py b/abs/core/LinHES-config/mv_common.py
index 5257a5a..0f78312 100755
--- a/abs/core/LinHES-config/mv_common.py
+++ b/abs/core/LinHES-config/mv_common.py
@@ -2,6 +2,7 @@
import logging, os, time
import commands
import ConfigParser
+import urllib2
config_file = "mv_config"
data_config = __import__(config_file, globals(), locals(), [])
@@ -11,6 +12,38 @@ try:
except:
logging.info("couldn't read mythvantage.cfg")
+class config_extra_reader(object):
+ def __init__(self,url):
+ self.url=url
+ self.Config = ConfigParser.ConfigParser()
+ req = urllib2.Request(url)
+ response = urllib2.urlopen(req)
+ self.Config.readfp(response)
+
+ def print_url(self):
+ print self.url
+
+
+ def print_sections(self):
+ print self.Config.sections()
+
+
+ def read_config(self,data):
+ rvalue = True
+ section = "extra"
+ try:
+ rvalue = self.Config.get(section, data)
+ if rvalue == "False":
+ rvalue = False
+ if rvalue == "no":
+ rvalue = False
+ except:
+ logging.debug("Couldn't read config_file")
+ rvalue = True
+
+ return rvalue
+
+
def read_config(module_config,data):
rvalue = True
@@ -61,6 +94,20 @@ def cp_and_log(srcfile,destfile):
cmd = ("rsync -arhp %s %s") %(srcfile,destfile)
runcmd(cmd)
+def link_file(srcfile,link_name):
+ logging.info(" Trying to link %s -> %s",srcfile,link_name)
+ if not os.path.exists(srcfile):
+ logging.info(" %s is not present, skipping...",srcfile)
+ elif os.path.exists(link_name):
+ logging.info(" %s is present, skipping...",link_name)
+ else:
+ try:
+ os.symlink(srcfile, link_name)
+ except:
+ logging.info(" Problem linking files occured")
+
+ return
+
def add_service(daemon):
logging.info(" Adding service %s",daemon)