summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/MythVantage-config/mv_smolt.py
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2009-08-18 04:11:57 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2009-08-18 04:11:57 (GMT)
commita1521d388a79d6792af788406224c3963e77c765 (patch)
tree2bda56e29a3b5f7ff7621f4b1df9d2eca405aba0 /abs/mv-core/MythVantage-config/mv_smolt.py
parent4a416bea72be751fe503edebe21c8708c0e5dce4 (diff)
parent9800bb0789a9b3655a679e996841bdb51a609d22 (diff)
downloadlinhes_pkgbuild-a1521d388a79d6792af788406224c3963e77c765.zip
linhes_pkgbuild-a1521d388a79d6792af788406224c3963e77c765.tar.gz
linhes_pkgbuild-a1521d388a79d6792af788406224c3963e77c765.tar.bz2
Merge branch 'HEAD' of ssh://cesman@knoppmyth.net/mount/repository/LinHES-PKGBUILD
Diffstat (limited to 'abs/mv-core/MythVantage-config/mv_smolt.py')
-rwxr-xr-xabs/mv-core/MythVantage-config/mv_smolt.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/abs/mv-core/MythVantage-config/mv_smolt.py b/abs/mv-core/MythVantage-config/mv_smolt.py
new file mode 100755
index 0000000..5fd3722
--- /dev/null
+++ b/abs/mv-core/MythVantage-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.debug(" 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")
+