fix delete when hpc object has no cmi object id; add silent=true for originserver
diff --git a/planetstack/hpc_observer/steps/sync_cdnprefix.py b/planetstack/hpc_observer/steps/sync_cdnprefix.py
index b773df9..b887e84 100644
--- a/planetstack/hpc_observer/steps/sync_cdnprefix.py
+++ b/planetstack/hpc_observer/steps/sync_cdnprefix.py
@@ -62,4 +62,5 @@
cp.save()
def delete_record(self, m):
- self.client.onev.Delete("CDNPrefix", m.cdn_prefix_id)
+ if m.cdn_prefix_id is not None:
+ self.client.onev.Delete("CDNPrefix", m.cdn_prefix_id)
diff --git a/planetstack/hpc_observer/steps/sync_contentprovider.py b/planetstack/hpc_observer/steps/sync_contentprovider.py
index c7335d6..cebe186 100644
--- a/planetstack/hpc_observer/steps/sync_contentprovider.py
+++ b/planetstack/hpc_observer/steps/sync_contentprovider.py
@@ -62,5 +62,6 @@
cp.save()
def delete_record(self, m):
- self.client.onev.Delete("ContentProvider", m.content_provider_id)
+ if m.content_provider_id is not None:
+ self.client.onev.Delete("ContentProvider", m.content_provider_id)
diff --git a/planetstack/hpc_observer/steps/sync_originserver.py b/planetstack/hpc_observer/steps/sync_originserver.py
index 6fb6234..92ac0f4 100644
--- a/planetstack/hpc_observer/steps/sync_originserver.py
+++ b/planetstack/hpc_observer/steps/sync_originserver.py
@@ -69,7 +69,9 @@
url = url[7:]
self.client.cob.UpdateContent(ors.origin_server_id, {"url": url})
+ ors.silent = True
ors.save()
- def delete(self, m):
- self.client.onev.Delete("OriginServer", m.origin_server_id)
+ def delete_record(self, m):
+ if m.origin_server_id is not None:
+ self.client.onev.Delete("OriginServer", m.origin_server_id)
diff --git a/planetstack/hpc_observer/steps/sync_serviceprovider.py b/planetstack/hpc_observer/steps/sync_serviceprovider.py
index 19c6db3..78fd196 100644
--- a/planetstack/hpc_observer/steps/sync_serviceprovider.py
+++ b/planetstack/hpc_observer/steps/sync_serviceprovider.py
@@ -52,5 +52,5 @@
sp.save()
def delete_record(self, m):
- print "XXX delete service provider", m
- self.client.onev.Delete("ServiceProvider", m.service_provider_id)
+ if m.service_provider_id is not None:
+ self.client.onev.Delete("ServiceProvider", m.service_provider_id)