Tony Mack | 71592a5 | 2013-03-28 20:17:47 -0400 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | import os |
| 3 | import sys |
Tony Mack | 704c1b0 | 2013-04-17 10:45:45 -0400 | [diff] [blame^] | 4 | import thread |
Tony Mack | 71592a5 | 2013-03-28 20:17:47 -0400 | [diff] [blame] | 5 | |
| 6 | from plstackapi.planetstack.config import Config |
Tony Mack | 704c1b0 | 2013-04-17 10:45:45 -0400 | [diff] [blame^] | 7 | from plstackapi.openstack.sliveragent import SliverAgent |
Tony Mack | 71592a5 | 2013-03-28 20:17:47 -0400 | [diff] [blame] | 8 | |
| 9 | if __name__ == '__main__': |
| 10 | |
| 11 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "plstackapi.planetstack.settings") |
| 12 | from django.core.management import ManagementUtility |
| 13 | config = Config() |
Tony Mack | e02d720 | 2013-03-29 11:23:56 -0400 | [diff] [blame] | 14 | url = "%s:%s" % (config.api_host, config.api_port) |
Tony Mack | 71592a5 | 2013-03-28 20:17:47 -0400 | [diff] [blame] | 15 | args = [__file__, 'runserver', url] |
| 16 | server = ManagementUtility(args) |
Tony Mack | 704c1b0 | 2013-04-17 10:45:45 -0400 | [diff] [blame^] | 17 | sliver_agent = SliverAgent() |
| 18 | thread.start_new_thread(server.execute, ()) |
| 19 | thread.start_new_thread(sliver_agent.run, ()) |
| 20 | #server.execute() |