Workaround for a very annoying issue. For some reason, policy handlers
authorSapan Bhatia <gwsapan@gmail.com>
Mon, 15 Sep 2014 07:48:20 +0000 (03:48 -0400)
committerSapan Bhatia <gwsapan@gmail.com>
Mon, 15 Sep 2014 07:48:20 +0000 (03:48 -0400)
cannot import models globally

planetstack/ec2_observer/__init__.pyc
planetstack/ec2_observer/event_manager.pyc
planetstack/model_policies/__init__.py
planetstack/model_policies/model_policy_Network.py
planetstack/model_policies/model_policy_Slice.py
planetstack/model_policies/model_policy_User.py

index c43a857..0be477a 100644 (file)
Binary files a/planetstack/ec2_observer/__init__.pyc and b/planetstack/ec2_observer/__init__.pyc differ
index d514197..a916928 100644 (file)
Binary files a/planetstack/ec2_observer/event_manager.pyc and b/planetstack/ec2_observer/event_manager.pyc differ
index e69de29..8671d6a 100644 (file)
@@ -0,0 +1,3 @@
+from .model_policy_Slice import *
+from .model_policy_User import *
+from .model_policy_Network import *
index 0511bee..f48b25a 100644 (file)
@@ -1,6 +1,8 @@
 from core.models import *
 
 def handle(network):
+       from core.models import SliceDeployments,NetworkDeployments
+       from collections import defaultdict
        # network deployments are not visible to users. We must ensure
        # networks are deployed at all deploymets available to their slices.
        slice_deployments = SliceDeployments.objects.all()
index 5d66903..6fd968c 100644 (file)
@@ -1,6 +1,7 @@
-from core.models import *
 
 def handle(slice):
+       from core.models import SiteDeployments,SliceDeployments,Deployment
+       from collections import defaultdict
        site_deployments = SiteDeployments.objects.all()
        site_deploy_lookup = defaultdict(list)
        for site_deployment in site_deployments:
index 1b1895e..6118a7b 100644 (file)
@@ -1,6 +1,8 @@
 from core.models import *
 
 def handle(user):
+       from core.models import Deployment,SiteDeployments,UserDeployments
+       from collections import defaultdict
        deployments = Deployment.objects.all()
        site_deployments = SiteDeployments.objects.all()
        site_deploy_lookup = defaultdict(list)