CC-3484: Pypo: On bootup, it should grab station name and stream label

for liquidsoap

- fixed
This commit is contained in:
James 2012-03-26 17:44:07 -04:00
parent 44e8e96cc8
commit ef801c7a10
2 changed files with 11 additions and 6 deletions

View File

@ -660,6 +660,7 @@ class AirTimeApiClient(ApiClientInterface):
response = json.loads(response)
logger.info("Bootstrap info retrieved %s", response)
except Exception, e:
response = None
import traceback
top = traceback.format_exc()
logger.error('Exception: %s', e)

View File

@ -150,12 +150,16 @@ class PypoFetch(Thread):
def set_bootstrap_variables(self):
self.logger.debug('Getting information needed on bootstrap from Airtime')
info = self.api_client.get_bootstrap_info()
self.logger.debug('info:%s',info)
for k, v in info['switch_status'].iteritems():
self.switch_source(k, v)
self.update_liquidsoap_stream_format(info['stream_label'])
self.update_liquidsoap_station_name(info['station_name'])
self.update_liquidsoap_transition_fade(info['transition_fade'])
if info == None:
self.logger.error('Unable to get bootstrap info.. Existing pypo...')
sys.exit(0)
else:
self.logger.debug('info:%s',info)
for k, v in info['switch_status'].iteritems():
self.switch_source(k, v)
self.update_liquidsoap_stream_format(info['stream_label'])
self.update_liquidsoap_station_name(info['station_name'])
self.update_liquidsoap_transition_fade(info['transition_fade'])
def regenerateLiquidsoapConf(self, setting_p):
existing = {}