blob: 2a5353e2112245866535d4248f8c5ee02f485fae [file] [log] [blame]
Tony Mack71592a52013-03-28 20:17:47 -04001#!/usr/bin/env python
2import os
3import sys
Tony Mack745bf6e2013-04-17 11:06:35 -04004import threading
Tony Mack71592a52013-03-28 20:17:47 -04005
6from plstackapi.planetstack.config import Config
Tony Mack704c1b02013-04-17 10:45:45 -04007from plstackapi.openstack.sliveragent import SliverAgent
Tony Mack71592a52013-03-28 20:17:47 -04008
9if __name__ == '__main__':
10
11 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings")
12 from django.core.management import ManagementUtility
13 config = Config()
Tony Macke02d7202013-03-29 11:23:56 -040014 url = "%s:%s" % (config.api_host, config.api_port)
Tony Mack71592a52013-03-28 20:17:47 -040015 args = [__file__, 'runserver', url]
16 server = ManagementUtility(args)
Tony Mack704c1b02013-04-17 10:45:45 -040017 sliver_agent = SliverAgent()
Tony Mack745bf6e2013-04-17 11:06:35 -040018 sliver_agent_thread = threading.Thread(target=sliver_agent.run)
19 sliver_agent_thread.start()
20 server.execute()