Merge lp:~sandy-walsh/nova/v1_1_novaclient into lp:~hudson-openstack/nova/trunk
- v1_1_novaclient
- Merge into trunk
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 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Josh Kearney (community) | Approve | ||
Devin Carlen (community) | Approve | ||
Review via email: mp+70474@code.launchpad.net |
Commit message
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.
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.
-------
Traceback (most recent call last):
File "/usr/local/
self.setUp()
File "/usr/local/
self.
File "/usr/local/
try_
File "/usr/local/
return func()
File "/tmp/tmpRO6FYP
from nova.network import manager as network_manager
File "/tmp/tmpRO6FYP
from nova import manager
File "/tmp/tmpRO6FYP
from nova.scheduler import api
File "/tmp/tmpRO6FYP
from novaclient import v1_1 as novaclient
ImportError: cannot import name v1_1
-------
Ran 0 tests in 0.038s
FAILED (errors=1)
Sandy Walsh (sandy-walsh) wrote : | # |
We have to wait until 2.6.0 is available first. Stay tuned.
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.
-------
Traceback (most recent call last):
File "/usr/local/
self.setUp()
File "/usr/local/
self.
File "/usr/local/
try_
File "/usr/local/
return func()
File "/tmp/tmpAl4ecr
from nova.network import manager as network_manager
File "/tmp/tmpAl4ecr
from nova import manager
File "/tmp/tmpAl4ecr
from nova.scheduler import api
File "/tmp/tmpAl4ecr
from novaclient import v1_1 as novaclient
ImportError: cannot import name v1_1
-------
Ran 0 tests in 0.467s
FAILED (errors=1)
Sandy Walsh (sandy-walsh) wrote : | # |
Hudson ... you know what you can do?
(PS, I did integration testing on it now too)
Sandy Walsh (sandy-walsh) wrote : | # |
Seems jenkins isn't pulling the latest novaclient (2.6.0)
Vish Ishaya (vishvananda) wrote : | # |
Doesn't look like it is in the trunk ppa:
python-novaclient 2.5.9~bzr65-
On Aug 5, 2011, at 8:15 AM, Sandy Walsh wrote:
> Seems jenkins isn't pulling the latest novaclient (2.6.0)
> --
> https:/
> You are subscribed to branch lp:nova.
OpenStack Infra (hudson-openstack) wrote : | # |
Attempt to merge into lp:nova failed due to conflicts:
text conflict in nova/api/
text conflict in nova/db/
Sandy Walsh (sandy-walsh) wrote : | # |
fixed trunk conflicts
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.
Sandy Walsh (sandy-walsh) wrote : | # |
oh for the love of all that is holy ...
Unmerged revisions
Preview Diff
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 | 156 | """ | 156 | """ |
6 | 157 | parsed_url = urlparse.urlsplit(href) | 157 | parsed_url = urlparse.urlsplit(href) |
7 | 158 | new_path = re.sub(r'^/v[0-9]+\.[0-9]+(/|$)', r'\1', parsed_url.path, | 158 | new_path = re.sub(r'^/v[0-9]+\.[0-9]+(/|$)', r'\1', parsed_url.path, |
9 | 159 | count=1) | 159 | count=1) |
10 | 160 | 160 | ||
11 | 161 | if new_path == parsed_url.path: | 161 | if new_path == parsed_url.path: |
12 | 162 | msg = _('href %s does not contain version') % href | 162 | msg = _('href %s does not contain version') % href |
13 | 163 | 163 | ||
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 | 166 | return self.helper._get_server_admin_password_old_style(server) | 166 | return self.helper._get_server_admin_password_old_style(server) |
19 | 167 | 167 | ||
20 | 168 | 168 | ||
22 | 169 | class ControllerV11(object): | 169 | class ControllerV11(Controller): |
23 | 170 | """Controller for 1.1 Zone resources.""" | 170 | """Controller for 1.1 Zone resources.""" |
24 | 171 | 171 | ||
25 | 172 | def _get_server_admin_password(self, server): | 172 | def _get_server_admin_password(self, server): |
26 | 173 | 173 | ||
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 | 16 | export NOVA_USERNAME="%(user)s" | 16 | export NOVA_USERNAME="%(user)s" |
32 | 17 | export NOVA_PROJECT_ID="%(project)s" | 17 | export NOVA_PROJECT_ID="%(project)s" |
33 | 18 | export NOVA_URL="%(os)s" | 18 | export NOVA_URL="%(os)s" |
34 | 19 | export NOVA_VERSION="1.1" | ||
35 | 19 | 20 | ||
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 | 3307 | 3307 | ||
41 | 3308 | @require_context | 3308 | @require_context |
42 | 3309 | def instance_type_extra_specs_get_item(context, instance_type_id, key, | 3309 | def instance_type_extra_specs_get_item(context, instance_type_id, key, |
44 | 3310 | session=None): | 3310 | session=None): |
45 | 3311 | if not session: | 3311 | if not session: |
46 | 3312 | session = get_session() | 3312 | session = get_session() |
47 | 3313 | 3313 | ||
48 | 3314 | 3314 | ||
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 | 317 | DEFINE_string('osapi_host', '$my_ip', 'ip of api server') | 317 | DEFINE_string('osapi_host', '$my_ip', 'ip of api server') |
54 | 318 | DEFINE_string('osapi_scheme', 'http', 'prefix for openstack') | 318 | DEFINE_string('osapi_scheme', 'http', 'prefix for openstack') |
55 | 319 | DEFINE_integer('osapi_port', 8774, 'OpenStack API port') | 319 | DEFINE_integer('osapi_port', 8774, 'OpenStack API port') |
57 | 320 | DEFINE_string('osapi_path', '/v1.0/', 'suffix for openstack') | 320 | DEFINE_string('osapi_path', '/v1.1/', 'suffix for openstack') |
58 | 321 | DEFINE_integer('osapi_max_limit', 1000, | 321 | DEFINE_integer('osapi_max_limit', 1000, |
59 | 322 | 'max number of items returned in a collection response') | 322 | 'max number of items returned in a collection response') |
60 | 323 | 323 | ||
61 | 324 | 324 | ||
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 | 17 | Handles all requests relating to schedulers. | 17 | Handles all requests relating to schedulers. |
67 | 18 | """ | 18 | """ |
68 | 19 | 19 | ||
70 | 20 | import novaclient | 20 | from novaclient import v1_1 as novaclient |
71 | 21 | from novaclient import exceptions as novaclient_exceptions | ||
72 | 21 | 22 | ||
73 | 22 | from nova import db | 23 | from nova import db |
74 | 23 | from nova import exception | 24 | from nova import exception |
75 | @@ -112,7 +113,7 @@ | |||
76 | 112 | def _process(func, zone): | 113 | def _process(func, zone): |
77 | 113 | """Worker stub for green thread pool. Give the worker | 114 | """Worker stub for green thread pool. Give the worker |
78 | 114 | an authenticated nova client and zone info.""" | 115 | an authenticated nova client and zone info.""" |
80 | 115 | nova = novaclient.OpenStack(zone.username, zone.password, None, | 116 | nova = novaclient.Client(zone.username, zone.password, None, |
81 | 116 | zone.api_url) | 117 | zone.api_url) |
82 | 117 | nova.authenticate() | 118 | nova.authenticate() |
83 | 118 | return func(nova, zone) | 119 | return func(nova, zone) |
84 | @@ -132,10 +133,10 @@ | |||
85 | 132 | zones = db.zone_get_all(context) | 133 | zones = db.zone_get_all(context) |
86 | 133 | for zone in zones: | 134 | for zone in zones: |
87 | 134 | try: | 135 | try: |
89 | 135 | nova = novaclient.OpenStack(zone.username, zone.password, None, | 136 | nova = novaclient.Client(zone.username, zone.password, None, |
90 | 136 | zone.api_url) | 137 | zone.api_url) |
91 | 137 | nova.authenticate() | 138 | nova.authenticate() |
93 | 138 | except novaclient.exceptions.BadRequest, e: | 139 | except novaclient_exceptions.BadRequest, e: |
94 | 139 | url = zone.api_url | 140 | url = zone.api_url |
95 | 140 | LOG.warn(_("Failed request to zone; URL=%(url)s: %(e)s") | 141 | LOG.warn(_("Failed request to zone; URL=%(url)s: %(e)s") |
96 | 141 | % locals()) | 142 | % locals()) |
97 | @@ -188,7 +189,7 @@ | |||
98 | 188 | if method_name in ['find', 'findall']: | 189 | if method_name in ['find', 'findall']: |
99 | 189 | try: | 190 | try: |
100 | 190 | return getattr(manager, method_name)(**kwargs) | 191 | return getattr(manager, method_name)(**kwargs) |
102 | 191 | except novaclient.NotFound: | 192 | except novaclient_exceptions.NotFound: |
103 | 192 | url = zone.api_url | 193 | url = zone.api_url |
104 | 193 | LOG.debug(_("%(collection)s.%(method_name)s didn't find " | 194 | LOG.debug(_("%(collection)s.%(method_name)s didn't find " |
105 | 194 | "anything matching '%(kwargs)s' on '%(url)s'" % | 195 | "anything matching '%(kwargs)s' on '%(url)s'" % |
106 | @@ -200,7 +201,7 @@ | |||
107 | 200 | item = args.pop(0) | 201 | item = args.pop(0) |
108 | 201 | try: | 202 | try: |
109 | 202 | result = manager.get(item) | 203 | result = manager.get(item) |
111 | 203 | except novaclient.NotFound: | 204 | except novaclient_exceptions.NotFound: |
112 | 204 | url = zone.api_url | 205 | url = zone.api_url |
113 | 205 | LOG.debug(_("%(collection)s '%(item)s' not found on '%(url)s'" % | 206 | LOG.debug(_("%(collection)s '%(item)s' not found on '%(url)s'" % |
114 | 206 | locals())) | 207 | locals())) |
115 | 207 | 208 | ||
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 | 24 | import json | 24 | import json |
121 | 25 | 25 | ||
122 | 26 | import M2Crypto | 26 | import M2Crypto |
124 | 27 | import novaclient | 27 | |
125 | 28 | from novaclient import v1_1 as novaclient | ||
126 | 29 | from novaclient import exceptions as novaclient_exceptions | ||
127 | 28 | 30 | ||
128 | 29 | from nova import crypto | 31 | from nova import crypto |
129 | 30 | from nova import db | 32 | from nova import db |
130 | @@ -118,10 +120,9 @@ | |||
131 | 118 | % locals()) | 120 | % locals()) |
132 | 119 | nova = None | 121 | nova = None |
133 | 120 | try: | 122 | try: |
136 | 121 | nova = novaclient.OpenStack(zone.username, zone.password, None, | 123 | nova = novaclient.Client(zone.username, zone.password, None, url) |
135 | 122 | url) | ||
137 | 123 | nova.authenticate() | 124 | nova.authenticate() |
139 | 124 | except novaclient.exceptions.BadRequest, e: | 125 | except novaclient_exceptions.BadRequest, e: |
140 | 125 | raise exception.NotAuthorized(_("Bad credentials attempting " | 126 | raise exception.NotAuthorized(_("Bad credentials attempting " |
141 | 126 | "to talk to zone at %(url)s.") % locals()) | 127 | "to talk to zone at %(url)s.") % locals()) |
142 | 127 | 128 | ||
143 | 128 | 129 | ||
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 | 18 | """ | 18 | """ |
149 | 19 | 19 | ||
150 | 20 | import datetime | 20 | import datetime |
151 | 21 | import novaclient | ||
152 | 22 | import thread | 21 | import thread |
153 | 23 | import traceback | 22 | import traceback |
154 | 24 | 23 | ||
155 | 24 | from novaclient import v1_1 as novaclient | ||
156 | 25 | |||
157 | 25 | from eventlet import greenpool | 26 | from eventlet import greenpool |
158 | 26 | 27 | ||
159 | 27 | from nova import db | 28 | from nova import db |
160 | @@ -89,8 +90,8 @@ | |||
161 | 89 | 90 | ||
162 | 90 | def _call_novaclient(zone): | 91 | def _call_novaclient(zone): |
163 | 91 | """Call novaclient. Broken out for testing purposes.""" | 92 | """Call novaclient. Broken out for testing purposes.""" |
166 | 92 | client = novaclient.OpenStack(zone.username, zone.password, None, | 93 | client = novaclient.Client(zone.username, zone.password, None, |
167 | 93 | zone.api_url) | 94 | zone.api_url) |
168 | 94 | return client.zones.info()._info | 95 | return client.zones.info()._info |
169 | 95 | 96 | ||
170 | 96 | 97 | ||
171 | 97 | 98 | ||
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 | 21 | 21 | ||
177 | 22 | import datetime | 22 | import datetime |
178 | 23 | import mox | 23 | import mox |
179 | 24 | import novaclient.exceptions | ||
180 | 25 | import stubout | 24 | import stubout |
181 | 26 | 25 | ||
182 | 26 | from novaclient import v1_1 as novaclient | ||
183 | 27 | from novaclient import exceptions as novaclient_exceptions | ||
184 | 28 | |||
185 | 27 | from mox import IgnoreArg | 29 | from mox import IgnoreArg |
186 | 28 | from nova import context | 30 | from nova import context |
187 | 29 | from nova import db | 31 | from nova import db |
188 | @@ -1036,10 +1038,10 @@ | |||
189 | 1036 | 1038 | ||
190 | 1037 | class FakeEmptyServerCollection(object): | 1039 | class FakeEmptyServerCollection(object): |
191 | 1038 | def get(self, f): | 1040 | def get(self, f): |
193 | 1039 | raise novaclient.NotFound(1) | 1041 | raise novaclient_exceptions.NotFound(1) |
194 | 1040 | 1042 | ||
195 | 1041 | def find(self, name): | 1043 | def find(self, name): |
197 | 1042 | raise novaclient.NotFound(2) | 1044 | raise novaclient_exceptions.NotFound(2) |
198 | 1043 | 1045 | ||
199 | 1044 | 1046 | ||
200 | 1045 | class FakeNovaClient(object): | 1047 | class FakeNovaClient(object): |
201 | @@ -1085,7 +1087,7 @@ | |||
202 | 1085 | raise Exception('testing') | 1087 | raise Exception('testing') |
203 | 1086 | 1088 | ||
204 | 1087 | 1089 | ||
206 | 1088 | class FakeNovaClientOpenStack(object): | 1090 | class FakeNovaClientZones(object): |
207 | 1089 | def __init__(self, *args, **kwargs): | 1091 | def __init__(self, *args, **kwargs): |
208 | 1090 | self.zones = FakeZonesProxy() | 1092 | self.zones = FakeZonesProxy() |
209 | 1091 | 1093 | ||
210 | @@ -1098,7 +1100,7 @@ | |||
211 | 1098 | super(CallZoneMethodTest, self).setUp() | 1100 | super(CallZoneMethodTest, self).setUp() |
212 | 1099 | self.stubs = stubout.StubOutForTesting() | 1101 | self.stubs = stubout.StubOutForTesting() |
213 | 1100 | self.stubs.Set(db, 'zone_get_all', zone_get_all) | 1102 | self.stubs.Set(db, 'zone_get_all', zone_get_all) |
215 | 1101 | self.stubs.Set(novaclient, 'OpenStack', FakeNovaClientOpenStack) | 1103 | self.stubs.Set(novaclient, 'Client', FakeNovaClientZones) |
216 | 1102 | 1104 | ||
217 | 1103 | def tearDown(self): | 1105 | def tearDown(self): |
218 | 1104 | self.stubs.UnsetAll() | 1106 | self.stubs.UnsetAll() |
219 | 1105 | 1107 | ||
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 | 18 | 18 | ||
225 | 19 | import datetime | 19 | import datetime |
226 | 20 | import mox | 20 | import mox |
227 | 21 | import novaclient | ||
228 | 22 | 21 | ||
229 | 23 | from nova import context | 22 | from nova import context |
230 | 24 | from nova import db | 23 | from nova import db |
231 | 25 | 24 | ||
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 | 9 | carrot==0.10.5 | 9 | carrot==0.10.5 |
237 | 10 | eventlet | 10 | eventlet |
238 | 11 | lockfile==0.8 | 11 | lockfile==0.8 |
240 | 12 | python-novaclient==2.5.9 | 12 | python-novaclient==2.6.0 |
241 | 13 | python-daemon==1.5.5 | 13 | python-daemon==1.5.5 |
242 | 14 | python-gflags==1.3 | 14 | python-gflags==1.3 |
243 | 15 | redis==2.0.0 | 15 | redis==2.0.0 |
lgtm