summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_hostype.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-09-29 20:10:02 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-09-29 20:10:02 (GMT)
commit822ebc824685b558d6baa1fe81d2ce58e2235808 (patch)
tree3b1d87f0954420908590e2be793c71c178d55382 /abs/core/LinHES-config/mv_hostype.py
parent95144ae80ab0a96d02c11d4219f6841f59acf5fa (diff)
downloadlinhes_pkgbuild-822ebc824685b558d6baa1fe81d2ce58e2235808.zip
linhes_pkgbuild-822ebc824685b558d6baa1fe81d2ce58e2235808.tar.gz
linhes_pkgbuild-822ebc824685b558d6baa1fe81d2ce58e2235808.tar.bz2
LinHES config: several changes here
- added modules config_xml calling this will setup config.xml for mythtv and root user - install_db_chroot.sh will now generate the default settings and load them into a table - mv_install now calles myth_settings_wrapper.sh to load the default db
Diffstat (limited to 'abs/core/LinHES-config/mv_hostype.py')
-rwxr-xr-xabs/core/LinHES-config/mv_hostype.py95
1 files changed, 5 insertions, 90 deletions
diff --git a/abs/core/LinHES-config/mv_hostype.py b/abs/core/LinHES-config/mv_hostype.py
index 5655986..473cc94 100755
--- a/abs/core/LinHES-config/mv_hostype.py
+++ b/abs/core/LinHES-config/mv_hostype.py
@@ -60,77 +60,16 @@ def setup_mysqlnetwork(EnableNetwork):
mv_common.restart_service("mysql")
-def generate_config_xml(uuid,dbhost):
- configxml_t ='''
-<Configuration>
- <UPnP>
- <UDN>
- <MediaRenderer>%s</MediaRenderer>
- </UDN>
- <MythFrontend>
- <DefaultBackend>
- <DBHostName>%s</DBHostName>
- <DBUserName>mythtv</DBUserName>
- <DBPassword>mythtv</DBPassword>
- <DBName>mythconverg</DBName>
- <DBPort>0</DBPort>
- </DefaultBackend>
- </MythFrontend>
- </UPnP>
-</Configuration>
- '''
- configxml= configxml_t %(uuid,dbhost)
- return configxml
-
-def gen_uuid():
- cmd = "/usr/bin/uuidgen"
- uuid = mv_common.runcmd_output(cmd)
- return uuid
+
+
def setup_mysql_connection(systemconfig):
- #setup mysql.txt and config.xml
+
logging.info(" Configuring database connection")
mythip = systemconfig.get("mythip")
systemtype = systemconfig.get("SystemType")
- mv_root = systemconfig.get("MVROOT")
- mysqltxt = "/usr/share/mythtv/mysql.txt"
- configxml_file = "/usr/share/mythtv/config.xml"
-
- templates = systemconfig.get("TEMPLATES")
- mysqltemplate = templates + "/mysql.txt"
dbhost = systemconfig.get("dbhost")
- uuid = gen_uuid()
- config_xml=generate_config_xml(uuid,dbhost)
- mv_common.mkdir_mythhome(data_config.MYTHHOME,"mythtv","mythtv")
-
-
-
- delfile = data_config.MYTHHOME + "/.mythtv/mysql.txt"
- mv_common.remove_file(delfile)
- delfile = mv_root + "/bin/mythtv/.mythtv/mysql.txt"
- mv_common.remove_file(delfile)
- filecheck = data_config.MYTHHOME + "/templates/mysql.txt"
- if os.path.exists(filecheck):
- logging.info(" Scrapping all the previous work and using %s for mysql.txt", filecheck)
- mv_common.cp_and_log(filecheck, mysqltxt)
- try:
- f = open(configxml_file, 'w')
-
- for outline in config_xml:
- f.write(outline)
- f.close()
- except:
- logging.debug(" Couldn't write config.xml")
-
- home_xml_file=data_config.MYTHHOME + "/.mythtv/config.xml"
- mv_common.link_file(configxml_file,home_xml_file)
-
- #setup link for root user
- mv_common.mkdir_mythhome("/root","root","root")
- home_xml_file="/root/.mythtv/config.xml"
- mv_common.link_file(configxml_file,home_xml_file)
-
-
+ mv_root = systemconfig.get("MVROOT")
if systemtype == "Master_backend":
logging.debug(" Setting dbhost to %s in systemconfig", mythip)
@@ -154,6 +93,7 @@ def setup_mysql_connection(systemconfig):
if systemtype == "Standalone":
+ #THIS IS NEVER CALLED ANYMORE, need to move the mysql.txt stuff
logging.debug(" changing mysql.txt file to use localhost")
cmd = '''sed -e "s/^DBHostName=.*$/DBHostName="localhost"/" %s > %s ''' %(mysqltemplate, mysqltxt)
mv_common.runcmd(cmd)
@@ -171,31 +111,6 @@ def setup_mysql_connection(systemconfig):
#mv_common.runcmd(cmd)
b=mv_common.runcmd_output(cmd)
logging.debug(b)
- #else:
- #logging.debug(" changing mysql.txt file to use %s", dbhost)
- #cmd = '''sed -e "s/^DBHostName=.*$/DBHostName=%s/" %s > %s ''' %(dbhost, mysqltemplate, mysqltxt)
- #mv_common.runcmd(cmd)
-
- #delfile = data_config.MYTHHOME + "/.mythtv/mysql.txt"
- #mv_common.remove_file(delfile)
- #delfile = mv_root + "/bin/mythtv/.mythtv/mysql.txt"
- #mv_common.remove_file(delfile)
- #filecheck = data_config.MYTHHOME + "/templates/mysql.txt"
- #if os.path.exists(filecheck):
- #logging.info(" Scrapping all the previous work and using %s for mysql.txt", filecheck)
- #mv_common.cp_and_log(filecheck, mysqltxt)
- #try:
- #f = open(configxml_file, 'w')
-
- #for outline in config_xml:
- #f.write(outline)
- #f.close()
- #except:
- #logging.debug(" Couldn't write config.xml")
-
- #home_xml_file=data_config.MYTHHOME + "/.mythtv/config.xml"
- #mv_common.link_file(configxml_file,home_xml_file)
-