Merge branch 'master' of ssh://git.planet-lab.org/git/plstackapi
diff --git a/opencloud.spec b/opencloud.spec
index dc2c91a..6d79ed5 100644
--- a/opencloud.spec
+++ b/opencloud.spec
@@ -1,7 +1,7 @@
Summary: OpenCloud core services
Name: opencloud
-Version: 1.0.27
-Release: 3
+Version: 1.0.28
+Release: 2
License: GPL+
Group: Development/Tools
Source0: %{_tmppath}/%{name}-%{version}.tar.gz
diff --git a/planetstack/core/models/plcorebase.py b/planetstack/core/models/plcorebase.py
index e483a79..612e925 100644
--- a/planetstack/core/models/plcorebase.py
+++ b/planetstack/core/models/plcorebase.py
@@ -7,6 +7,7 @@
from django.utils import timezone
from django.core.exceptions import PermissionDenied
import model_policy
+from model_autodeletion import ephemeral_models
try:
# This is a no-op if observer_disabled is set to 1 in the config file
@@ -201,6 +202,10 @@
# filtering of visible objects by user.
return cls.objects.all()
+ @classmethod
+ def is_ephemeral(cls):
+ return cls in ephemeral_models
+
diff --git a/planetstack/core/models/slice.py b/planetstack/core/models/slice.py
index d438bdf..24d02aa 100644
--- a/planetstack/core/models/slice.py
+++ b/planetstack/core/models/slice.py
@@ -92,7 +92,15 @@
from core.models.network import Network
nets = Network.objects.filter(slices=self)
nets.delete()
+ # delete slice deployments
+ slice_deployments = SliceDeployments.objects.filter(slice=self)
+ slice_deployments.delete()
+ # delete slice privilege
+ slice_privileges = SlicePrivilege.objects.filter(slice=self)
+ slice_privileges.delete()
+ # continue with normal delete
super(SliceAdmin, self).delete(*args, **kwds)
+
class SliceRole(PlCoreBase):
ROLE_CHOICES = (('admin','Admin'),('default','Default'))
diff --git a/planetstack/dependency_walker.py b/planetstack/dependency_walker.py
index ca1959e..93e1847 100755
--- a/planetstack/dependency_walker.py
+++ b/planetstack/dependency_walker.py
@@ -79,6 +79,7 @@
for o in peer_objects:
fn(o, object)
+ # Uncomment the following line to enable recursion
# walk_inv_deps(fn, o)
def p(x):
diff --git a/planetstack/model_policies/model_policy_Slice.py b/planetstack/model_policies/model_policy_Slice.py
index 7523e3e..7b436b4 100644
--- a/planetstack/model_policies/model_policy_Slice.py
+++ b/planetstack/model_policies/model_policy_Slice.py
@@ -35,13 +35,13 @@
private_net = network
if not public_nets:
# ensure there is at least one public network, and default it to dedicated
- dedicated_public_net = Network(
- name = slice.name+'-public',
- template = NetworkTemplate.objects.get(name='Public dedicated IPv4'),
+ nat_net = Network(
+ name = slice.name+'-nat',
+ template = NetworkTemplate.objects.get(name='Public shared IPv4'),
owner = slice
)
- dedicated_public_net.save()
- public_nets.append(dedicated_public_net)
+ nat_net.save()
+ public_nets.append(nat_net)
if not private_net:
private_net = Network(
diff --git a/planetstack/openstack_observer/steps/sync_networks.py b/planetstack/openstack_observer/steps/sync_networks.py
index 5174fe6..99f2c01 100644
--- a/planetstack/openstack_observer/steps/sync_networks.py
+++ b/planetstack/openstack_observer/steps/sync_networks.py
@@ -21,6 +21,6 @@
for network_deployment in NetworkDeployments.objects.filter(network=network):
try:
network_deployment_deleter(network_deployment)
- except Exeption,e:
+ except Exception,e:
logger.log_exc("Failed to delete network deployment %s" % network_deployment)
raise e