summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-08-03 15:48:49 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2010-08-03 15:48:49 -0700
commit8261e26f78f061de5f5e98f8066da33f9b4e3a23 (patch)
tree205ba8311480340e7bf8509de657aae22a79da5e
parent83c4a429d29b7d69128d90504f6febc2efe1d3a3 (diff)
downloadnova-8261e26f78f061de5f5e98f8066da33f9b4e3a23.tar.gz
nova-8261e26f78f061de5f5e98f8066da33f9b4e3a23.tar.xz
nova-8261e26f78f061de5f5e98f8066da33f9b4e3a23.zip
use get to retrieve node_name from initial_state
-rw-r--r--nova/compute/model.py3
1 files changed, 2 insertions, 1 deletions
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)