Merge lp:~gundlach/nova/lp659330 into lp:~hudson-openstack/nova/trunk

Proposed by Michael Gundlach
Status: Merged
Approved by: Michael Gundlach
Approved revision: 343
Merged at revision: 342
Proposed branch: lp:~gundlach/nova/lp659330
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 25 lines (+2/-2)
2 files modified
nova/compute/manager.py (+1/-1)
nova/db/sqlalchemy/models.py (+1/-1)
To merge this branch: bzr merge lp:~gundlach/nova/lp659330
Reviewer Review Type Date Requested Status
Rick Clark (community) Approve
Review via email: mp+38251@code.launchpad.net

Description of the change

Make Instance.name a string again instead of an integer.

Prefix it with some characters for good measure in case any code consumes .name and can't handle strings of the form /[0-9]+/.

To post a comment you must log in.
Revision history for this message
Chuck Short (zulcss) wrote :

+1 from me.

Revision history for this message
Rick Clark (dendrobates) wrote :

I'm getting dizzy. lgtm

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (25.0 KiB)

The attempt to merge lp:~gundlach/nova/lp659330 into lp:nova failed. Below is the output from the failed tests.

nova.tests.access_unittest
  AccessTestCase
    test_001_allow_all ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_002_allow_none ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_003_allow_project_manager ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_004_allow_sys_and_net ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
nova.tests.api_unittest
  ApiEc2TestCase
    test_describe_instances ... /var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
                                           [OK]
    test_get_all_key_pairs ... /var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
                                            [OK]
nova.tests.auth_unittest
  AuthManagerDbTestCase
    test_004_signature_is_valid ... [OK]
    test_005_can_get_credentials ... [OK]
    test_add_user_role_doesnt_infect_project_roles ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_adding_role_to_project_is_ignored_unless_added_to_user ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_can_add_and_remove_user_role ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_can_add_remove_user_with_role ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_can_add_user_to_project ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_can_create_and_get_project ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_can_create_and_get_project_with_attributes ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalchemy/api.py:42: DeprecationWarning: Use of empty request context is deprecated
    test_can_create_project_with_manager ... [OK]
/var/lib/hudson/src/nova/hudson/nova/db/sqlalche...

lp:~gundlach/nova/lp659330 updated
343. By Michael Gundlach

Now that the ec2 id is not the same as the name of the instance, don't compare internal_id [nee ec2_id] to instance names provided by the virtualization driver. Compare names directly instead.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/compute/manager.py'
2--- nova/compute/manager.py 2010-10-04 17:52:08 +0000
3+++ nova/compute/manager.py 2010-10-12 17:44:41 +0000
4@@ -67,7 +67,7 @@
5 def run_instance(self, context, instance_id, **_kwargs):
6 """Launch a new instance with specified options."""
7 instance_ref = self.db.instance_get(context, instance_id)
8- if instance_ref['internal_id'] in self.driver.list_instances():
9+ if instance_ref['name'] in self.driver.list_instances():
10 raise exception.Error("Instance has already been created")
11 logging.debug("instance %s: starting...", instance_id)
12 project_id = instance_ref['project_id']
13
14=== modified file 'nova/db/sqlalchemy/models.py'
15--- nova/db/sqlalchemy/models.py 2010-10-05 14:55:31 +0000
16+++ nova/db/sqlalchemy/models.py 2010-10-12 17:44:41 +0000
17@@ -169,7 +169,7 @@
18
19 @property
20 def name(self):
21- return self.internal_id
22+ return "instance-%d" % self.internal_id
23
24 image_id = Column(String(255))
25 kernel_id = Column(String(255))