Merge lp:~vishvananda/nova/fix-state-description into lp:~hudson-openstack/nova/trunk

Proposed by Vish Ishaya
Status: Merged
Approved by: Devin Carlen
Approved revision: 1522
Merged at revision: 1522
Proposed branch: lp:~vishvananda/nova/fix-state-description
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 107 lines (+12/-11)
4 files modified
bin/nova-manage (+3/-3)
nova/api/ec2/admin.py (+2/-3)
nova/api/openstack/contrib/simple_tenant_usage.py (+1/-1)
nova/tests/test_libvirt.py (+6/-4)
To merge this branch: bzr merge lp:~vishvananda/nova/fix-state-description
Reviewer Review Type Date Requested Status
Devin Carlen (community) Approve
Brian Waldon (community) Approve
Alex Meade (community) Approve
Brian Lamar (community) Approve
Review via email: mp+73715@code.launchpad.net

Description of the change

Fix a few references to state_description that slipped through.

To post a comment you must log in.
Revision history for this message
Brian Lamar (blamar) wrote :

Arg! Sorry about this Vish. ack-grep the tool I used to search for state and state_description evidently doesn't search non-.py files and the ec2/admin.py changes must have slipped in between the time I merge propped and getting it accepted.

Thanks for cleaning this up.

review: Approve
Revision history for this message
Alex Meade (alex-meade) wrote :

simple enough

review: Approve
Revision history for this message
Brian Waldon (bcwaldon) wrote :

Fantastic.

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/nova-manage'
--- bin/nova-manage 2011-08-26 22:07:34 +0000
+++ bin/nova-manage 2011-09-01 19:32:25 +0000
@@ -166,7 +166,7 @@
166 print address,166 print address,
167 print vpn['host'],167 print vpn['host'],
168 print ec2utils.id_to_ec2_id(vpn['id']),168 print ec2utils.id_to_ec2_id(vpn['id']),
169 print vpn['state_description'],169 print vpn['vm_state'],
170 print state170 print state
171 else:171 else:
172 print None172 print None
@@ -869,7 +869,7 @@
869 instance['hostname'],869 instance['hostname'],
870 instance['host'],870 instance['host'],
871 instance['instance_type'].name,871 instance['instance_type'].name,
872 instance['state_description'],872 instance['vm_state'],
873 instance['launched_at'],873 instance['launched_at'],
874 instance['image_ref'],874 instance['image_ref'],
875 instance['kernel_id'],875 instance['kernel_id'],
@@ -1223,7 +1223,7 @@
1223 type=vc['instance_type']['name'],1223 type=vc['instance_type']['name'],
1224 fl_ip=floating_addr,1224 fl_ip=floating_addr,
1225 fx_ip=fixed_addr,1225 fx_ip=fixed_addr,
1226 stat=vc['state_description'],1226 stat=vc['vm_state'],
1227 host=vc['host'],1227 host=vc['host'],
1228 time=str(vc['created_at']))1228 time=str(vc['created_at']))
12291229
12301230
=== modified file 'nova/api/ec2/admin.py'
--- nova/api/ec2/admin.py 2011-08-18 02:31:01 +0000
+++ nova/api/ec2/admin.py 2011-09-01 19:32:25 +0000
@@ -21,7 +21,6 @@
21"""21"""
2222
23import base6423import base64
24import datetime
25import netaddr24import netaddr
26import urllib25import urllib
2726
@@ -33,6 +32,7 @@
33from nova import utils32from nova import utils
34from nova.api.ec2 import ec2utils33from nova.api.ec2 import ec2utils
35from nova.auth import manager34from nova.auth import manager
35from nova.compute import vm_states
3636
3737
38FLAGS = flags.FLAGS38FLAGS = flags.FLAGS
@@ -273,8 +273,7 @@
273 """Get the VPN instance for a project ID."""273 """Get the VPN instance for a project ID."""
274 for instance in db.instance_get_all_by_project(context, project_id):274 for instance in db.instance_get_all_by_project(context, project_id):
275 if (instance['image_id'] == str(FLAGS.vpn_image_id)275 if (instance['image_id'] == str(FLAGS.vpn_image_id)
276 and not instance['state_description'] in276 and not instance['vm_state'] in [vm_states.DELETED]):
277 ['shutting_down', 'shutdown']):
278 return instance277 return instance
279278
280 def start_vpn(self, context, project):279 def start_vpn(self, context, project):
281280
=== modified file 'nova/api/openstack/contrib/simple_tenant_usage.py'
--- nova/api/openstack/contrib/simple_tenant_usage.py 2011-08-30 19:41:30 +0000
+++ nova/api/openstack/contrib/simple_tenant_usage.py 2011-09-01 19:32:25 +0000
@@ -116,7 +116,7 @@
116 if info['ended_at']:116 if info['ended_at']:
117 info['state'] = 'terminated'117 info['state'] = 'terminated'
118 else:118 else:
119 info['state'] = instance['state_description']119 info['state'] = instance['vm_state']
120120
121 now = datetime.utcnow()121 now = datetime.utcnow()
122122
123123
=== modified file 'nova/tests/test_libvirt.py'
--- nova/tests/test_libvirt.py 2011-08-24 23:48:04 +0000
+++ nova/tests/test_libvirt.py 2011-09-01 19:32:25 +0000
@@ -34,6 +34,7 @@
34from nova import utils34from nova import utils
35from nova.api.ec2 import cloud35from nova.api.ec2 import cloud
36from nova.compute import power_state36from nova.compute import power_state
37from nova.compute import vm_states
37from nova.virt.libvirt import connection38from nova.virt.libvirt import connection
38from nova.virt.libvirt import firewall39from nova.virt.libvirt import firewall
3940
@@ -674,8 +675,9 @@
674675
675 # Preparing data676 # Preparing data
676 self.compute = utils.import_object(FLAGS.compute_manager)677 self.compute = utils.import_object(FLAGS.compute_manager)
677 instance_dict = {'host': 'fake', 'state': power_state.RUNNING,678 instance_dict = {'host': 'fake',
678 'state_description': 'running'}679 'power_state': power_state.RUNNING,
680 'vm_state': vm_states.ACTIVE}
679 instance_ref = db.instance_create(self.context, self.test_instance)681 instance_ref = db.instance_create(self.context, self.test_instance)
680 instance_ref = db.instance_update(self.context, instance_ref['id'],682 instance_ref = db.instance_update(self.context, instance_ref['id'],
681 instance_dict)683 instance_dict)
@@ -713,8 +715,8 @@
713 self.compute.rollback_live_migration)715 self.compute.rollback_live_migration)
714716
715 instance_ref = db.instance_get(self.context, instance_ref['id'])717 instance_ref = db.instance_get(self.context, instance_ref['id'])
716 self.assertTrue(instance_ref['state_description'] == 'running')718 self.assertTrue(instance_ref['vm_state'] == vm_states.ACTIVE)
717 self.assertTrue(instance_ref['state'] == power_state.RUNNING)719 self.assertTrue(instance_ref['power_state'] == power_state.RUNNING)
718 volume_ref = db.volume_get(self.context, volume_ref['id'])720 volume_ref = db.volume_get(self.context, volume_ref['id'])
719 self.assertTrue(volume_ref['status'] == 'in-use')721 self.assertTrue(volume_ref['status'] == 'in-use')
720722