From 5b43cef510b68cff1f6e2f80742d3204b0b51e45 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Mon, 7 Jan 2013 15:12:39 +1300 Subject: [PATCH] Handle compute node records with no timestamp. Commit 94560ab57d9fc23673f42017e6f2a78cb2b66b7a added a fast-path to avoid work when baremetal compute nodes haven't changed, but if the compute message has None for its updated-at timestamp (which can happen during startup) the comparison crashes. Fixes bug: 1096719 Change-Id: Ib8add431d975eee133deefea62eb53479a97396e (cherry picked from commit fad69df25ffcea2a44cbf3ef636a68863a2d64d9) --- nova/scheduler/host_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nova/scheduler/host_manager.py b/nova/scheduler/host_manager.py index 8f439545831..e40673184e6 100644 --- a/nova/scheduler/host_manager.py +++ b/nova/scheduler/host_manager.py @@ -122,7 +122,8 @@ def update_capabilities(self, topic, capabilities=None, service=None): def update_from_compute_node(self, compute): """Update information about a host from its compute_node info.""" - if self.updated and self.updated > compute['updated_at']: + if (self.updated and compute['updated_at'] + and self.updated > compute['updated_at']): return all_ram_mb = compute['memory_mb']