Merge lp:~jk0/nova/lp821622 into lp:~hudson-openstack/nova/trunk

Proposed by Josh Kearney
Status: Merged
Approved by: Ed Leafe
Approved revision: 1387
Merged at revision: 1387
Proposed branch: lp:~jk0/nova/lp821622
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 87 lines (+13/-4)
5 files modified
nova/api/direct.py (+1/-0)
nova/api/openstack/common.py (+2/-1)
nova/db/sqlalchemy/api.py (+8/-2)
nova/tests/test_image.py (+2/-0)
nova/tests/test_xenapi.py (+0/-1)
To merge this branch: bzr merge lp:~jk0/nova/lp821622
Reviewer Review Type Date Requested Status
Ed Leafe (community) Approve
Sandy Walsh (community) Approve
Review via email: mp+70621@code.launchpad.net

Description of the change

Allow actions queries by UUID and PEP8 fixes.

To post a comment you must log in.
Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

Alakazam!

review: Approve
Revision history for this message
Ed Leafe (ed-leafe) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/api/direct.py'
2--- nova/api/direct.py 2011-08-03 23:17:08 +0000
3+++ nova/api/direct.py 2011-08-05 19:31:26 +0000
4@@ -48,6 +48,7 @@
5 # Global storage for registering modules.
6 ROUTES = {}
7
8+
9 def register_service(path, handle):
10 """Register a service handle at a given path.
11
12
13=== modified file 'nova/api/openstack/common.py'
14--- nova/api/openstack/common.py 2011-08-05 02:22:13 +0000
15+++ nova/api/openstack/common.py 2011-08-05 19:31:26 +0000
16@@ -154,7 +154,8 @@
17
18 """
19 parsed_url = urlparse.urlsplit(href)
20- new_path = re.sub(r'^/v[0-9]+\.[0-9]+(/|$)', r'\1', parsed_url.path, count=1)
21+ new_path = re.sub(r'^/v[0-9]+\.[0-9]+(/|$)', r'\1', parsed_url.path,
22+ count=1)
23
24 if new_path == parsed_url.path:
25 msg = _('href %s does not contain version') % href
26
27=== modified file 'nova/db/sqlalchemy/api.py'
28--- nova/db/sqlalchemy/api.py 2011-08-03 23:17:08 +0000
29+++ nova/db/sqlalchemy/api.py 2011-08-05 19:31:26 +0000
30@@ -1426,9 +1426,14 @@
31 def instance_get_actions(context, instance_id):
32 """Return the actions associated to the given instance id"""
33 session = get_session()
34+
35+ if utils.is_uuid_like(instance_id):
36+ instance = instance_get_by_uuid(context, instance_id, session)
37+ instance_id = instance.id
38+
39 return session.query(models.InstanceActions).\
40 filter_by(instance_id=instance_id).\
41- all()
42+ all()
43
44
45 ###################
46@@ -3301,7 +3306,8 @@
47
48
49 @require_context
50-def instance_type_extra_specs_get_item(context, instance_type_id, key, session=None):
51+def instance_type_extra_specs_get_item(context, instance_type_id, key,
52+ session=None):
53 if not session:
54 session = get_session()
55
56
57=== modified file 'nova/tests/test_image.py'
58--- nova/tests/test_image.py 2011-08-05 13:37:36 +0000
59+++ nova/tests/test_image.py 2011-08-05 19:31:26 +0000
60@@ -22,6 +22,7 @@
61 from nova import test
62 import nova.image
63
64+
65 class _ImageTestCase(test.TestCase):
66 def setUp(self):
67 super(_ImageTestCase, self).setUp()
68@@ -126,6 +127,7 @@
69 index = self.image_service.index(self.context)
70 self.assertEquals(len(index), 0)
71
72+
73 class FakeImageTestCase(_ImageTestCase):
74 def setUp(self):
75 super(FakeImageTestCase, self).setUp()
76
77=== modified file 'nova/tests/test_xenapi.py'
78--- nova/tests/test_xenapi.py 2011-08-05 14:07:48 +0000
79+++ nova/tests/test_xenapi.py 2011-08-05 19:31:26 +0000
80@@ -767,7 +767,6 @@
81 conn = xenapi_conn.get_connection(False)
82 conn.migrate_disk_and_power_off(instance, '127.0.0.1')
83
84-
85 def test_revert_migrate(self):
86 instance = db.instance_create(self.context, self.values)
87 self.called = False