Merge lp:~sandy-walsh/nova/v1_1_novaclient into lp:~hudson-openstack/nova/trunk

Proposed by Sandy Walsh
Status: Superseded
Proposed branch: lp:~sandy-walsh/nova/v1_1_novaclient
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 243 lines (+29/-24)
11 files modified
nova/api/openstack/common.py (+1/-1)
nova/api/openstack/zones.py (+1/-1)
nova/auth/novarc.template (+1/-0)
nova/db/sqlalchemy/api.py (+1/-1)
nova/flags.py (+1/-1)
nova/scheduler/api.py (+7/-6)
nova/scheduler/zone_aware_scheduler.py (+5/-4)
nova/scheduler/zone_manager.py (+4/-3)
nova/tests/scheduler/test_scheduler.py (+7/-5)
nova/tests/test_zones.py (+0/-1)
tools/pip-requires (+1/-1)
To merge this branch: bzr merge lp:~sandy-walsh/nova/v1_1_novaclient
Reviewer Review Type Date Requested Status
Josh Kearney (community) Approve
Devin Carlen (community) Approve
Review via email: mp+70474@code.launchpad.net

Description of the change

Adds support for the pending novaclient 2.6.0 changes, which add OS API 1.1 support.

Inter-zone communication will now use v1.1 by default.

This branch still needs to be properly integration tested, but this branch should keep trunk from breaking.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Josh Kearney (jk0) wrote :

LGTM

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

The attempt to merge lp:~sandy-walsh/nova/v1_1_novaclient into lp:nova failed. Below is the output from the failed tests.

ERROR

======================================================================
ERROR: <nose.suite.ContextSuite context=nova.tests>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 208, in run
    self.setUp()
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 291, in setUp
    self.setupContext(ancestor)
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 314, in setupContext
    try_run(context, names)
  File "/usr/local/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/tmp/tmpRO6FYP/nova/tests/__init__.py", line 47, in setup
    from nova.network import manager as network_manager
  File "/tmp/tmpRO6FYP/nova/network/manager.py", line 59, in <module>
    from nova import manager
  File "/tmp/tmpRO6FYP/nova/manager.py", line 60, in <module>
    from nova.scheduler import api
  File "/tmp/tmpRO6FYP/nova/scheduler/api.py", line 20, in <module>
    from novaclient import v1_1 as novaclient
ImportError: cannot import name v1_1

----------------------------------------------------------------------
Ran 0 tests in 0.038s

FAILED (errors=1)

Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

We have to wait until 2.6.0 is available first. Stay tuned.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

The attempt to merge lp:~sandy-walsh/nova/v1_1_novaclient into lp:nova failed. Below is the output from the failed tests.

ERROR

======================================================================
ERROR: <nose.suite.ContextSuite context=nova.tests>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 208, in run
    self.setUp()
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 291, in setUp
    self.setupContext(ancestor)
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 314, in setupContext
    try_run(context, names)
  File "/usr/local/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/tmp/tmpAl4ecr/nova/tests/__init__.py", line 47, in setup
    from nova.network import manager as network_manager
  File "/tmp/tmpAl4ecr/nova/network/manager.py", line 59, in <module>
    from nova import manager
  File "/tmp/tmpAl4ecr/nova/manager.py", line 60, in <module>
    from nova.scheduler import api
  File "/tmp/tmpAl4ecr/nova/scheduler/api.py", line 20, in <module>
    from novaclient import v1_1 as novaclient
ImportError: cannot import name v1_1

----------------------------------------------------------------------
Ran 0 tests in 0.467s

FAILED (errors=1)

Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

Hudson ... you know what you can do?

(PS, I did integration testing on it now too)

Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

Seems jenkins isn't pulling the latest novaclient (2.6.0)

Revision history for this message
Vish Ishaya (vishvananda) wrote :

Doesn't look like it is in the trunk ppa:

 python-novaclient 2.5.9~bzr65-0ubuntu0ppa1~oneiric1 (Newer version available)

On Aug 5, 2011, at 8:15 AM, Sandy Walsh wrote:

> Seems jenkins isn't pulling the latest novaclient (2.6.0)
> --
> https://code.launchpad.net/~sandy-walsh/nova/v1_1_novaclient/+merge/70474
> You are subscribed to branch lp:nova.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Attempt to merge into lp:nova failed due to conflicts:

text conflict in nova/api/openstack/common.py
text conflict in nova/db/sqlalchemy/api.py

Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

fixed trunk conflicts

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

oh for the love of all that is holy ...

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/api/openstack/common.py'
2--- nova/api/openstack/common.py 2011-08-05 23:51:17 +0000
3+++ nova/api/openstack/common.py 2011-08-08 16:27:51 +0000
4@@ -156,7 +156,7 @@
5 """
6 parsed_url = urlparse.urlsplit(href)
7 new_path = re.sub(r'^/v[0-9]+\.[0-9]+(/|$)', r'\1', parsed_url.path,
8- count=1)
9+ count=1)
10
11 if new_path == parsed_url.path:
12 msg = _('href %s does not contain version') % href
13
14=== modified file 'nova/api/openstack/zones.py'
15--- nova/api/openstack/zones.py 2011-07-21 14:02:16 +0000
16+++ nova/api/openstack/zones.py 2011-08-08 16:27:51 +0000
17@@ -166,7 +166,7 @@
18 return self.helper._get_server_admin_password_old_style(server)
19
20
21-class ControllerV11(object):
22+class ControllerV11(Controller):
23 """Controller for 1.1 Zone resources."""
24
25 def _get_server_admin_password(self, server):
26
27=== modified file 'nova/auth/novarc.template'
28--- nova/auth/novarc.template 2011-06-08 18:16:10 +0000
29+++ nova/auth/novarc.template 2011-08-08 16:27:51 +0000
30@@ -16,3 +16,4 @@
31 export NOVA_USERNAME="%(user)s"
32 export NOVA_PROJECT_ID="%(project)s"
33 export NOVA_URL="%(os)s"
34+export NOVA_VERSION="1.1"
35
36=== modified file 'nova/db/sqlalchemy/api.py'
37--- nova/db/sqlalchemy/api.py 2011-08-05 19:28:22 +0000
38+++ nova/db/sqlalchemy/api.py 2011-08-08 16:27:51 +0000
39@@ -3307,7 +3307,7 @@
40
41 @require_context
42 def instance_type_extra_specs_get_item(context, instance_type_id, key,
43- session=None):
44+ session=None):
45 if not session:
46 session = get_session()
47
48
49=== modified file 'nova/flags.py'
50--- nova/flags.py 2011-08-03 08:39:27 +0000
51+++ nova/flags.py 2011-08-08 16:27:51 +0000
52@@ -317,7 +317,7 @@
53 DEFINE_string('osapi_host', '$my_ip', 'ip of api server')
54 DEFINE_string('osapi_scheme', 'http', 'prefix for openstack')
55 DEFINE_integer('osapi_port', 8774, 'OpenStack API port')
56-DEFINE_string('osapi_path', '/v1.0/', 'suffix for openstack')
57+DEFINE_string('osapi_path', '/v1.1/', 'suffix for openstack')
58 DEFINE_integer('osapi_max_limit', 1000,
59 'max number of items returned in a collection response')
60
61
62=== modified file 'nova/scheduler/api.py'
63--- nova/scheduler/api.py 2011-07-01 13:44:12 +0000
64+++ nova/scheduler/api.py 2011-08-08 16:27:51 +0000
65@@ -17,7 +17,8 @@
66 Handles all requests relating to schedulers.
67 """
68
69-import novaclient
70+from novaclient import v1_1 as novaclient
71+from novaclient import exceptions as novaclient_exceptions
72
73 from nova import db
74 from nova import exception
75@@ -112,7 +113,7 @@
76 def _process(func, zone):
77 """Worker stub for green thread pool. Give the worker
78 an authenticated nova client and zone info."""
79- nova = novaclient.OpenStack(zone.username, zone.password, None,
80+ nova = novaclient.Client(zone.username, zone.password, None,
81 zone.api_url)
82 nova.authenticate()
83 return func(nova, zone)
84@@ -132,10 +133,10 @@
85 zones = db.zone_get_all(context)
86 for zone in zones:
87 try:
88- nova = novaclient.OpenStack(zone.username, zone.password, None,
89+ nova = novaclient.Client(zone.username, zone.password, None,
90 zone.api_url)
91 nova.authenticate()
92- except novaclient.exceptions.BadRequest, e:
93+ except novaclient_exceptions.BadRequest, e:
94 url = zone.api_url
95 LOG.warn(_("Failed request to zone; URL=%(url)s: %(e)s")
96 % locals())
97@@ -188,7 +189,7 @@
98 if method_name in ['find', 'findall']:
99 try:
100 return getattr(manager, method_name)(**kwargs)
101- except novaclient.NotFound:
102+ except novaclient_exceptions.NotFound:
103 url = zone.api_url
104 LOG.debug(_("%(collection)s.%(method_name)s didn't find "
105 "anything matching '%(kwargs)s' on '%(url)s'" %
106@@ -200,7 +201,7 @@
107 item = args.pop(0)
108 try:
109 result = manager.get(item)
110- except novaclient.NotFound:
111+ except novaclient_exceptions.NotFound:
112 url = zone.api_url
113 LOG.debug(_("%(collection)s '%(item)s' not found on '%(url)s'" %
114 locals()))
115
116=== modified file 'nova/scheduler/zone_aware_scheduler.py'
117--- nova/scheduler/zone_aware_scheduler.py 2011-08-05 23:41:03 +0000
118+++ nova/scheduler/zone_aware_scheduler.py 2011-08-08 16:27:51 +0000
119@@ -24,7 +24,9 @@
120 import json
121
122 import M2Crypto
123-import novaclient
124+
125+from novaclient import v1_1 as novaclient
126+from novaclient import exceptions as novaclient_exceptions
127
128 from nova import crypto
129 from nova import db
130@@ -118,10 +120,9 @@
131 % locals())
132 nova = None
133 try:
134- nova = novaclient.OpenStack(zone.username, zone.password, None,
135- url)
136+ nova = novaclient.Client(zone.username, zone.password, None, url)
137 nova.authenticate()
138- except novaclient.exceptions.BadRequest, e:
139+ except novaclient_exceptions.BadRequest, e:
140 raise exception.NotAuthorized(_("Bad credentials attempting "
141 "to talk to zone at %(url)s.") % locals())
142
143
144=== modified file 'nova/scheduler/zone_manager.py'
145--- nova/scheduler/zone_manager.py 2011-07-07 20:30:58 +0000
146+++ nova/scheduler/zone_manager.py 2011-08-08 16:27:51 +0000
147@@ -18,10 +18,11 @@
148 """
149
150 import datetime
151-import novaclient
152 import thread
153 import traceback
154
155+from novaclient import v1_1 as novaclient
156+
157 from eventlet import greenpool
158
159 from nova import db
160@@ -89,8 +90,8 @@
161
162 def _call_novaclient(zone):
163 """Call novaclient. Broken out for testing purposes."""
164- client = novaclient.OpenStack(zone.username, zone.password, None,
165- zone.api_url)
166+ client = novaclient.Client(zone.username, zone.password, None,
167+ zone.api_url)
168 return client.zones.info()._info
169
170
171
172=== modified file 'nova/tests/scheduler/test_scheduler.py'
173--- nova/tests/scheduler/test_scheduler.py 2011-08-03 21:08:22 +0000
174+++ nova/tests/scheduler/test_scheduler.py 2011-08-08 16:27:51 +0000
175@@ -21,9 +21,11 @@
176
177 import datetime
178 import mox
179-import novaclient.exceptions
180 import stubout
181
182+from novaclient import v1_1 as novaclient
183+from novaclient import exceptions as novaclient_exceptions
184+
185 from mox import IgnoreArg
186 from nova import context
187 from nova import db
188@@ -1036,10 +1038,10 @@
189
190 class FakeEmptyServerCollection(object):
191 def get(self, f):
192- raise novaclient.NotFound(1)
193+ raise novaclient_exceptions.NotFound(1)
194
195 def find(self, name):
196- raise novaclient.NotFound(2)
197+ raise novaclient_exceptions.NotFound(2)
198
199
200 class FakeNovaClient(object):
201@@ -1085,7 +1087,7 @@
202 raise Exception('testing')
203
204
205-class FakeNovaClientOpenStack(object):
206+class FakeNovaClientZones(object):
207 def __init__(self, *args, **kwargs):
208 self.zones = FakeZonesProxy()
209
210@@ -1098,7 +1100,7 @@
211 super(CallZoneMethodTest, self).setUp()
212 self.stubs = stubout.StubOutForTesting()
213 self.stubs.Set(db, 'zone_get_all', zone_get_all)
214- self.stubs.Set(novaclient, 'OpenStack', FakeNovaClientOpenStack)
215+ self.stubs.Set(novaclient, 'Client', FakeNovaClientZones)
216
217 def tearDown(self):
218 self.stubs.UnsetAll()
219
220=== modified file 'nova/tests/test_zones.py'
221--- nova/tests/test_zones.py 2011-07-07 19:55:34 +0000
222+++ nova/tests/test_zones.py 2011-08-08 16:27:51 +0000
223@@ -18,7 +18,6 @@
224
225 import datetime
226 import mox
227-import novaclient
228
229 from nova import context
230 from nova import db
231
232=== modified file 'tools/pip-requires'
233--- tools/pip-requires 2011-08-02 19:03:33 +0000
234+++ tools/pip-requires 2011-08-08 16:27:51 +0000
235@@ -9,7 +9,7 @@
236 carrot==0.10.5
237 eventlet
238 lockfile==0.8
239-python-novaclient==2.5.9
240+python-novaclient==2.6.0
241 python-daemon==1.5.5
242 python-gflags==1.3
243 redis==2.0.0