summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_misc.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2011-08-19 18:23:42 (GMT)
committerJames Meyer <james.meyer@operamail.com>2011-08-19 18:23:42 (GMT)
commit855cc7eb5a1ec13cc4ac28a910c79633703aa18f (patch)
tree8e740605bbbdd5cb0d959072201e3d2b66a821a4 /abs/core/LinHES-config/mv_misc.py
parentb1b4f59f40b122ee1a9cfa0c3a0f7a6a3b488f5f (diff)
downloadlinhes_pkgbuild-855cc7eb5a1ec13cc4ac28a910c79633703aa18f.zip
linhes_pkgbuild-855cc7eb5a1ec13cc4ac28a910c79633703aa18f.tar.gz
linhes_pkgbuild-855cc7eb5a1ec13cc4ac28a910c79633703aa18f.tar.bz2
linhes-config: clean up etc/fstab (pts shm)
added service to list of things to unsquash .upgrades from CD will now work Converted most calls to the systemconfig dict to use .get. This will stop KEYERRORS form occuring.
Diffstat (limited to 'abs/core/LinHES-config/mv_misc.py')
-rwxr-xr-xabs/core/LinHES-config/mv_misc.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/abs/core/LinHES-config/mv_misc.py b/abs/core/LinHES-config/mv_misc.py
index 9ea9c95..f49615a 100755
--- a/abs/core/LinHES-config/mv_misc.py
+++ b/abs/core/LinHES-config/mv_misc.py
@@ -58,40 +58,40 @@ def setup_tz(timezone,TEMPLATES):
def setup_nfs(systemconfig):
nfslist=[]
logging.info("____Start of setup_nfs____")
- scrubnfs(systemconfig["TEMPLATES"])
+ scrubnfs(systemconfig.get("TEMPLATES"))
- if systemconfig["HaveCentralNFS"] == "yes":
+ if systemconfig.get("HaveCentralNFS") == "yes":
logging.debug(" Using a Central NFS server")
- if systemconfig["NFSserver"] == "file:nfsmap":
+ if systemconfig.get("NFSserver") == "file:nfsmap":
#if it's a file check for it, failure results in downloading attempt from MBE
nfsmap_file=data_config.MYTHHOME+"/templates/nfsmap"
if not os.path.exists(nfsmap_file):
logging.debug(" Couldn't find local %s",nfsmap_file)
logging.info(" Trying to download nfsmap from MBE")
- nfsmap_file = download_nfsmap(systemconfig["dbhost"])
+ nfsmap_file = download_nfsmap(systemconfig.get("dbhost"))
nfslist = process_nfsmap_file(nfsmap_file)
# if it's an ip parse ip and download file
- elif re.search(systemconfig["NFSserver"],":nfsmap"):
- ip=systemconfig["NFSserver"].split(":")[0]
+ elif re.search(systemconfig.get("NFSserver"),":nfsmap"):
+ ip=systemconfig.get("NFSserver").split(":")[0]
nfsmap_file = download_nfsmap(ip)
nfslist = process_nfsmap_file(nfsmap_file)
#else treat it as a single mount point
else:
- item = (systemconfig["NFSserver"] , systemconfig["NFSmount"])
+ item = (systemconfig.get("NFSserver") , systemconfig["NFSmount"])
nfslist.append(item)
else:
#if standalone or slave try to use MBE
- if systemconfig["SystemType"] == "Frontend_only" or systemconfig["SystemType"] == "Slave_Backend":
- item = (systemconfig["dbhost"] , data_config.DATAMOUNT)
+ if systemconfig.get("SystemType") == "Frontend_only" or systemconfig["SystemType"] == "Slave_Backend":
+ item = (systemconfig.get("dbhost") , data_config.DATAMOUNT)
nfslist.append(item)
setup_nfs_fstab(nfslist)
logging.info("__End of nfs\n")
def setup_sleep(systemconfig):
logging.debug("____Setting up sleep____")
- autoshutdown = systemconfig["AutoShutdown"]
- stime1 = systemconfig["Shutdowntime"]
- stime2 = systemconfig["Shutdowntime2"]
+ autoshutdown = systemconfig.get("AutoShutdown")
+ stime1 = systemconfig.get("Shutdowntime")
+ stime2 = systemconfig.get("Shutdowntime2")
cstime1=''
if autoshutdown == "1" :
@@ -104,11 +104,11 @@ def setup_sleep(systemconfig):
else:
cshutdown = stime2
logging.debug(" Shutdown time at %s",cshutdown)
- cmd='''sed -e "s/HOUR/%s/g" %s/cron.template | crontab - -u mythtv''' %(cshutdown,systemconfig["TEMPLATES"])
+ cmd='''sed -e "s/HOUR/%s/g" %s/cron.template | crontab - -u mythtv''' %(cshutdown,systemconfig.get("TEMPLATES"))
mv_common.runcmd(cmd)
else:
logging.info(" Shutdown not enabled")
- cmd='''sed -e "/00 HOUR.*/d" %s/cron.template | crontab - -u mythtv''' %systemconfig["TEMPLATES"]
+ cmd='''sed -e "/00 HOUR.*/d" %s/cron.template | crontab - -u mythtv''' %systemconfig.get("TEMPLATES")
mv_common.runcmd(cmd)
logging.debug("__End of sleep\n")