Steps in which deletion is not supported have to return an empty list
when queried for deleted objects.
diff --git a/planetstack/openstack_observer/steps/sync_image_deployments.py b/planetstack/openstack_observer/steps/sync_image_deployments.py
index 4a69b1c..20c22a2 100644
--- a/planetstack/openstack_observer/steps/sync_image_deployments.py
+++ b/planetstack/openstack_observer/steps/sync_image_deployments.py
@@ -14,7 +14,9 @@
provides=[ImageDeployments]
requested_interval=0
- def fetch_pending(self):
+ def fetch_pending(self, deleted):
+ if (deleted):
+ return []
# smbaker: commented out automatic creation of ImageDeployments as
# as they will now be configured in GUI. Not sure if this is
# sufficient.
diff --git a/planetstack/openstack_observer/steps/sync_images.py b/planetstack/openstack_observer/steps/sync_images.py
index 2c24e83..9b915fb 100644
--- a/planetstack/openstack_observer/steps/sync_images.py
+++ b/planetstack/openstack_observer/steps/sync_images.py
@@ -9,7 +9,12 @@
provides=[Image]
requested_interval=0
- def fetch_pending(self):
+ def fetch_pending(self, deleted):
+ # Images come from the back end
+ # You can't delete them
+ if (deleted):
+ return []
+
# get list of images on disk
images_path = Config().observer_images_directory
available_images = {}
diff --git a/planetstack/openstack_observer/steps/sync_nodes.py b/planetstack/openstack_observer/steps/sync_nodes.py
index 030d57c..740b5e1 100644
--- a/planetstack/openstack_observer/steps/sync_nodes.py
+++ b/planetstack/openstack_observer/steps/sync_nodes.py
@@ -12,7 +12,12 @@
provides=[Node]
requested_interval=0
- def fetch_pending(self):
+ def fetch_pending(self, deleted):
+ # Nodes come from the back end
+ # You can't delete them
+ if (deleted):
+ return []
+
# collect local nodes
sites = Site.objects.all()
nodes = Node.objects.all()
diff --git a/planetstack/openstack_observer/steps/sync_roles.py b/planetstack/openstack_observer/steps/sync_roles.py
index e3a20e9..bb837db 100644
--- a/planetstack/openstack_observer/steps/sync_roles.py
+++ b/planetstack/openstack_observer/steps/sync_roles.py
@@ -11,7 +11,11 @@
provides=[Role]
requested_interval=0
- def fetch_pending(self):
+ def fetch_pending(self, deleted):
+ # Deleting roles is not supported yet
+ if (deleted):
+ return []
+
site_roles = SiteRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
slice_roles = SliceRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
deployment_roles = DeploymentRole.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
diff --git a/planetstack/openstack_observer/steps/sync_site_privileges.py b/planetstack/openstack_observer/steps/sync_site_privileges.py
index 8724841..d07b279 100644
--- a/planetstack/openstack_observer/steps/sync_site_privileges.py
+++ b/planetstack/openstack_observer/steps/sync_site_privileges.py
@@ -9,7 +9,11 @@
requested_interval=0
provides=[SitePrivilege]
- def fetch_pending(self):
+ def fetch_pending(self, deleted):
+ # Deleting site privileges is not supported yet
+ if (deleted):
+ return []
+
return SitePrivilege.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
def sync_record(self, site_priv):
diff --git a/planetstack/openstack_observer/steps/sync_slice_memberships.py b/planetstack/openstack_observer/steps/sync_slice_memberships.py
index d2ec03e..b1cd223 100644
--- a/planetstack/openstack_observer/steps/sync_slice_memberships.py
+++ b/planetstack/openstack_observer/steps/sync_slice_memberships.py
@@ -13,7 +13,10 @@
requested_interval=0
provides=[SlicePrivilege]
- def fetch_pending(self):
+ def fetch_pending(self, deleted):
+ # Deleting site memberships is not supported yet
+ if (deleted):
+ return []
return SlicePrivilege.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
def sync_record(self, slice_memb):
diff --git a/planetstack/openstack_observer/steps/sync_sliver_ips.py b/planetstack/openstack_observer/steps/sync_sliver_ips.py
index e2212d1..bd1d572 100644
--- a/planetstack/openstack_observer/steps/sync_sliver_ips.py
+++ b/planetstack/openstack_observer/steps/sync_sliver_ips.py
@@ -9,7 +9,10 @@
provides=[Sliver]
requested_interval=0
- def fetch_pending(self):
+ def fetch_pending(self, deleted):
+ # Not supported yet
+ if (deleted):
+ return []
slivers = Sliver.objects.filter(ip=None)
return slivers