summaryrefslogtreecommitdiffstats
path: root/abs
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-06-01 20:22:13 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-06-01 20:22:13 (GMT)
commitb859b1baafe3d3a899c5f9c70a039327c57663e6 (patch)
tree161c570a249251a3753d75cee0e0a4c2c237c58e /abs
parent0275dd9b652a2bc4cce6011c49ee5a1595bb8fd0 (diff)
downloadlinhes_pkgbuild-b859b1baafe3d3a899c5f9c70a039327c57663e6.zip
linhes_pkgbuild-b859b1baafe3d3a899c5f9c70a039327c57663e6.tar.gz
linhes_pkgbuild-b859b1baafe3d3a899c5f9c70a039327c57663e6.tar.bz2
LinHES-config: Addition of smolt.py to run from systemconfig
Diffstat (limited to 'abs')
-rw-r--r--abs/core-testing/LinHES-config/mv_smolt.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/abs/core-testing/LinHES-config/mv_smolt.py b/abs/core-testing/LinHES-config/mv_smolt.py
new file mode 100644
index 0000000..e4fbaee
--- /dev/null
+++ b/abs/core-testing/LinHES-config/mv_smolt.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+import logging
+import mv_common
+
+def read_release(stype):
+ if stype == "LinHES":
+ rfile = "/etc/LinHES-release"
+ else:
+ rfile = "/etc/MythVantage-release"
+
+ try:
+ f= open(rfile,'r')
+ releasename = f.readlines()[0]
+ f.close()
+ except:
+ logging.debug(" Couldn't open %s",rfile)
+ releasename = "unknown"
+
+ return releasename
+
+
+def setup_smolt_type(SystemType,Remotetype,RunFrontend,mythhome,stype):
+ logging.debug("____Start of setup_smolt_type____")
+ releasename = read_release(stype)
+
+ if SystemType == "Standalone":
+ smoltsystem = 6
+ MVRELEASE="%s (Standalone)" %releasename
+ elif SystemType == "Master_backend":
+ if RunFrontend == "1":
+ smoltsystem = 2
+ MVRELEASE="%s (MBE with Frontend)" %releasename
+ else:
+ smoltsystem=1
+ MVRELEASE="%s (MBE)" %releasename
+ elif SystemType == "Slave_backend":
+ if RunFrontend == "1" :
+ smoltsystem = 4
+ MVRELEASE="%s (SLAVE with Frontend)" %releasename
+ else:
+ smoltsystem = 5
+ MVRELEASE="%s (SLAVE)" %releasename
+ elif SystemType == "Frontend_only":
+ smoltsystem = 3
+ MVRELEASE="%s ( Frontend only)" %releasename
+
+ logging.info(" smolt type is %s : %s", MVRELEASE,smoltsystem)
+ smoltfile = mythhome+"/.mythtv/smolt.info"
+ cmd = ''' echo "%s" > /etc/os_myth_release ''' %MVRELEASE
+ mv_common.runcmd(cmd)
+
+ cmd = '''echo "systemtype=%s" > %s''' %(smoltsystem,smoltfile)
+ mv_common.runcmd(cmd)
+
+ cmd = '''echo "remote=%s" >> %s ''' %(Remotetype,smoltfile)
+ mv_common.runcmd(cmd)
+
+ logging.debug("__End of setup_smolt_type")
+