Workaround for a very annoying issue. For some reason, policy handlers
cannot import models globally
diff --git a/planetstack/ec2_observer/__init__.pyc b/planetstack/ec2_observer/__init__.pyc
index c43a857..0be477a 100644
--- a/planetstack/ec2_observer/__init__.pyc
+++ b/planetstack/ec2_observer/__init__.pyc
Binary files differ
diff --git a/planetstack/ec2_observer/event_manager.pyc b/planetstack/ec2_observer/event_manager.pyc
index d514197..a916928 100644
--- a/planetstack/ec2_observer/event_manager.pyc
+++ b/planetstack/ec2_observer/event_manager.pyc
Binary files differ
diff --git a/planetstack/model_policies/__init__.py b/planetstack/model_policies/__init__.py
index e69de29..8671d6a 100644
--- a/planetstack/model_policies/__init__.py
+++ b/planetstack/model_policies/__init__.py
@@ -0,0 +1,3 @@
+from .model_policy_Slice import *
+from .model_policy_User import *
+from .model_policy_Network import *
diff --git a/planetstack/model_policies/model_policy_Network.py b/planetstack/model_policies/model_policy_Network.py
index 0511bee..f48b25a 100644
--- a/planetstack/model_policies/model_policy_Network.py
+++ b/planetstack/model_policies/model_policy_Network.py
@@ -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()
diff --git a/planetstack/model_policies/model_policy_Slice.py b/planetstack/model_policies/model_policy_Slice.py
index 5d66903..6fd968c 100644
--- a/planetstack/model_policies/model_policy_Slice.py
+++ b/planetstack/model_policies/model_policy_Slice.py
@@ -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:
diff --git a/planetstack/model_policies/model_policy_User.py b/planetstack/model_policies/model_policy_User.py
index 1b1895e..6118a7b 100644
--- a/planetstack/model_policies/model_policy_User.py
+++ b/planetstack/model_policies/model_policy_User.py
@@ -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)