From 35d3d63e08cd00b027ad36b4176dc8880c6e5878 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 16 Jul 2012 15:34:09 -0400 Subject: [PATCH] CC-4104: airtime-uninstall should not purge airtime database be default -on reinstall use the database --- install_minimal/airtime-install | 8 ++++---- .../generate_liquidsoap_cfg.py | 20 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/install_minimal/airtime-install b/install_minimal/airtime-install index 4a9ff3a25..41a508ca1 100755 --- a/install_minimal/airtime-install +++ b/install_minimal/airtime-install @@ -149,13 +149,13 @@ if [ "$result" -eq "0" ]; then rm -f "/etc/airtime/media-monitor.cfg" rm -f "/etc/airtime/pypo.cfg" elif [ "$result" -eq "1" -a "$reinstall" = "f" ]; then - echo " * Same version of Airtime already installed!" - exit 1; + echo " * Same version of Airtime already installed! Reusing database." + nodb='t' elif [ "$result" -eq "2" ]; then - echo " * Previous version of Airtime already installed..will perform upgrade" + echo " * Previous version of Airtime already installed..will perform upgrade." DO_UPGRADE="1" elif [ "$result" -eq "3" ]; then - echo " * You require at least Airtime 1.8.0 installed for upgrade" + echo " * You require at least Airtime 1.8.0 installed for upgrade." exit 1 fi diff --git a/python_apps/pypo/liquidsoap_scripts/generate_liquidsoap_cfg.py b/python_apps/pypo/liquidsoap_scripts/generate_liquidsoap_cfg.py index ad73c71ad..fd7b38646 100644 --- a/python_apps/pypo/liquidsoap_scripts/generate_liquidsoap_cfg.py +++ b/python_apps/pypo/liquidsoap_scripts/generate_liquidsoap_cfg.py @@ -1,6 +1,6 @@ import logging import sys -from api_clients import api_client +from api_clients.api_client import AirtimeApiClient def generate_liquidsoap_config(ss): data = ss['msg'] @@ -9,22 +9,22 @@ def generate_liquidsoap_config(ss): fh.write("# THIS FILE IS AUTO GENERATED. DO NOT CHANGE!! #\n") fh.write("################################################\n") for d in data: + + key = d['keyname'] + str_buffer = d[u'keyname'] + " = " if(d[u'type'] == 'string'): - temp = d[u'value'] - str_buffer += '"%s"' % temp + val = '"%s"' % d['value'] else: - temp = d[u'value'] - if(temp == ""): - temp = "0" - str_buffer += temp - str_buffer += "\n" - fh.write(api_client.encode_to(str_buffer)) + val = d[u'value'] + val = val if len(val) > 0 else "0" + str_buffer = "%s = %s\n" % (key, val) + fh.write(str_buffer) fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/