cc-4105: fixed bug where api client wasn't being initialized right by replaygain updater. updated apiclient to better detect such bad usage

This commit is contained in:
Rudi Grinberg 2012-08-09 12:13:44 -04:00
parent 3c82497c34
commit 5bc170ba31
3 changed files with 10 additions and 8 deletions

View file

@ -52,6 +52,9 @@ class AirtimeApiClient():
@staticmethod
def create_right_config(log=None,config_path=None):
if config_path: AirtimeApiClient.default_config = config_path
elif (not AirtimeApiClient.default_config):
raise ValueError("Cannot slip config_path attribute when it has \
never been passed yet")
return AirtimeApiClient( logger=None, config_path=AirtimeApiClient.default_config )
def __init__(self, logger=None,config_path='/etc/airtime/api_client.cfg'):
@ -465,6 +468,7 @@ class AirtimeApiClient():
except Exception, e:
response = None
logger.error("Exception: %s", e)
self.logger.debug(traceback.format_exc())
return response