fit threading bug
Tony Mack [Mon, 24 Jun 2013 19:08:01 +0000 (15:08 -0400)]
planetstack/openstack/backend.py
planetstack/openstack/observer.py
planetstack/planetstack-backend.py [new file with mode: 0644]
planetstack/plstackapi-debug-server.py [deleted file]
setup.py

index 340b29b..43afba7 100644 (file)
@@ -1,5 +1,4 @@
 import threading
-from openstack.sliveragent import SliverAgent
 from openstack.observer import OpenStackObserver
 from openstack.event_listener import EventListener
 
index 44908ab..6fcb3b4 100644 (file)
@@ -226,7 +226,7 @@ class OpenStackObserver:
         # get all users that need to be synced (enacted < updated or enacted is None)
         pending_slivers = Sliver.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
         for sliver in pending_slivers:
-            if not sliver.instance_id and sliver.creator: 
+            if sliver.creator: 
                 try: 
                     # update manager context
                     self.manager.init_caller(sliver.creator, sliver.slice.name)
diff --git a/planetstack/planetstack-backend.py b/planetstack/planetstack-backend.py
new file mode 100644 (file)
index 0000000..0270264
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+import os
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
+from openstack.backend import Backend 
+
+if __name__ == '__main__':
+
+    backend = Backend()
+    backend.run()
diff --git a/planetstack/plstackapi-debug-server.py b/planetstack/plstackapi-debug-server.py
deleted file mode 100644 (file)
index e120d72..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-import os
-import sys
-
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
-from planetstack.config import Config
-from openstack.backend import Backend 
-
-if __name__ == '__main__':
-
-    # bootstrap envirnment
-    from django.core.management import ManagementUtility
-    config = Config()
-    url = "%s:%s" % (config.api_host, config.api_port)
-    args = [__file__, 'runserver', url] 
-
-    
-    backend = Backend()
-    backend.run()
-    # start the server
-    server = ManagementUtility(args)
-    server.execute()
index 4f8f050..79a90ef 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ def copytree(src, dst, symlinks=False, ignore=None):
 setup(name='planetstack',
       version='0.1',
       description='PlanetStack',
-      scripts=['planetstack/plstackapi-debug-server.py'],
+      scripts=['planetstack/planetstack-backend.py'],
       data_files=[
         ('/etc/planetstack/', ['planetstack/plstackapi_config']),
         ])