From 8261e26f78f061de5f5e98f8066da33f9b4e3a23 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 3 Aug 2010 15:48:49 -0700 Subject: use get to retrieve node_name from initial_state --- nova/compute/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nova/compute/model.py b/nova/compute/model.py index 7dd130ca3..266a93b9a 100644 --- a/nova/compute/model.py +++ b/nova/compute/model.py @@ -151,7 +151,8 @@ class Instance(datastore.BasicModel): # it just adds the first one is_new = self.is_new_record() node_set = (self.state['node_name'] != 'unassigned' and - self.initial_state['node_name'] == 'unassigned') + self.initial_state.get('node_name', 'unassigned') + == 'unassigned') success = super(Instance, self).save() if success and is_new: self.associate_with("project", self.project) -- cgit