Trying to commit an unsaved object with fields set causes the database
to lock up.
diff --git a/planetstack/ec2_observer/syncstep.py b/planetstack/ec2_observer/syncstep.py
index d5f7523..31fec04 100644
--- a/planetstack/ec2_observer/syncstep.py
+++ b/planetstack/ec2_observer/syncstep.py
@@ -86,7 +86,8 @@
except:
o.backend_status = str(e)
- o.save(update_fields=['backend_status'])
+ if (o.pk):
+ o.save(update_fields=['backend_status'])
logger.log_exc("sync step failed!")
failed.append(o)
diff --git a/planetstack/openstack_observer/syncstep.py b/planetstack/openstack_observer/syncstep.py
index c77c8d5..324829d 100644
--- a/planetstack/openstack_observer/syncstep.py
+++ b/planetstack/openstack_observer/syncstep.py
@@ -84,7 +84,8 @@
except:
o.backend_status = str(e)
- o.save(update_fields=['backend_status'])
+ if (o.pk):
+ o.save(update_fields=['backend_status'])
logger.log_exc("sync step failed!")
failed.append(o)