Merge branch 'saas' into cc-5709-airtime-analyzer-cloud-storage-saas
Conflicts: .gitignore airtime_mvc/application/configs/airtime-conf.php airtime_mvc/application/configs/classmap-airtime-conf.php airtime_mvc/application/models/RabbitMq.php airtime_mvc/application/models/Schedule.php airtime_mvc/application/models/StoredFile.php airtime_mvc/application/models/airtime/map/CcShowInstancesTableMap.php airtime_mvc/application/models/airtime/map/CcShowTableMap.php airtime_mvc/application/models/airtime/om/BaseCcShow.php airtime_mvc/application/models/airtime/om/BaseCcShowInstances.php airtime_mvc/application/models/airtime/om/BaseCcShowInstancesPeer.php airtime_mvc/application/models/airtime/om/BaseCcShowInstancesQuery.php airtime_mvc/application/models/airtime/om/BaseCcShowPeer.php airtime_mvc/application/models/airtime/om/BaseCcShowQuery.php airtime_mvc/application/modules/rest/Bootstrap.php airtime_mvc/application/modules/rest/controllers/MediaController.php airtime_mvc/build/sql/schema.sql airtime_mvc/public/index.php
This commit is contained in:
commit
0a45de7fba
163 changed files with 67857 additions and 56085 deletions
|
@ -26,6 +26,10 @@ export LC_ALL=`cat /etc/default/locale | grep "LANG=" | cut -d= -f2 | tr -d "\n\
|
|||
export TERM=xterm
|
||||
|
||||
|
||||
#Nothing to do with Pypo, but for container maintenance. Let's parse the IP address
|
||||
#so we may more easily manage our instance containers
|
||||
ifconfig eth0 | egrep -o 'inet addr:([0-9]{1,3}\.){3}[0-9]{1,3}' | cut -d':' -f2 > /etc/airtime_ip_addr
|
||||
|
||||
exec python ${pypo_path}/${pypo_script} > /var/log/airtime/pypo/py-interpreter.log 2>&1
|
||||
|
||||
# EOF
|
||||
|
|
|
@ -81,10 +81,6 @@ try:
|
|||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
config['rabbitmq_user'] = os.environ['RABBITMQ_USER']
|
||||
config['rabbitmq_password'] = os.environ['RABBITMQ_PASSWORD']
|
||||
config['rabbitmq_vhost'] = os.environ['RABBITMQ_VHOST']
|
||||
config.write()
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
|
|
@ -50,6 +50,7 @@ def create_source()
|
|||
l = crossfade_airtime(l)
|
||||
|
||||
l = on_metadata(notify_queue, l)
|
||||
|
||||
sources := list.append([l], !sources)
|
||||
server.register(namespace="queues",
|
||||
"s#{!source_id}_skip",
|
||||
|
@ -71,7 +72,6 @@ create_source()
|
|||
create_source()
|
||||
|
||||
queue = add(!sources, normalize=false)
|
||||
|
||||
pair = insert_metadata(queue)
|
||||
dynamic_metadata_callback := fst(pair)
|
||||
queue = snd(pair)
|
||||
|
|
|
@ -10,10 +10,12 @@ import time
|
|||
from api_clients import api_client
|
||||
|
||||
class ListenerStat(Thread):
|
||||
|
||||
HTTP_REQUEST_TIMEOUT = 30 # 30 second HTTP request timeout
|
||||
|
||||
def __init__(self, logger=None):
|
||||
def __init__(self, config, logger=None):
|
||||
Thread.__init__(self)
|
||||
self.config = config
|
||||
self.api_client = api_client.AirtimeApiClient()
|
||||
if logger is None:
|
||||
self.logger = logging.getLogger()
|
||||
|
@ -50,12 +52,18 @@ class ListenerStat(Thread):
|
|||
|
||||
f = urllib2.urlopen(req, timeout=ListenerStat.HTTP_REQUEST_TIMEOUT)
|
||||
document = f.read()
|
||||
|
||||
return document
|
||||
|
||||
|
||||
def get_icecast_stats(self, ip):
|
||||
url = 'http://%(host)s:%(port)s/admin/stats.xml' % ip
|
||||
document = self.get_stream_server_xml(ip, url)
|
||||
document = None
|
||||
if "airtime.pro" in ip["host"].lower():
|
||||
url = 'http://%(host)s:%(port)s/stats.xsl' % ip
|
||||
document = self.get_stream_server_xml(ip, url)
|
||||
else:
|
||||
url = 'http://%(host)s:%(port)s/admin/stats.xml' % ip
|
||||
document = self.get_stream_server_xml(ip, url)
|
||||
dom = xml.dom.minidom.parseString(document)
|
||||
sources = dom.getElementsByTagName("source")
|
||||
|
||||
|
@ -158,5 +166,5 @@ if __name__ == "__main__":
|
|||
# add ch to logger
|
||||
#logger.addHandler(ch)
|
||||
|
||||
ls = ListenerStat(logger)
|
||||
ls.run()
|
||||
#ls = ListenerStat(logger=logger)
|
||||
#ls.run()
|
||||
|
|
|
@ -289,7 +289,7 @@ if __name__ == '__main__':
|
|||
recorder.daemon = True
|
||||
recorder.start()
|
||||
|
||||
stat = ListenerStat()
|
||||
stat = ListenerStat(config)
|
||||
stat.daemon = True
|
||||
stat.start()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue