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
=== modified file 'nova/api/openstack/common.py'
--- nova/api/openstack/common.py 2011-08-05 23:51:17 +0000
+++ nova/api/openstack/common.py 2011-08-08 16:27:51 +0000
@@ -156,7 +156,7 @@
156 """156 """
157 parsed_url = urlparse.urlsplit(href)157 parsed_url = urlparse.urlsplit(href)
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,
159 count=1)159 count=1)
160160
161 if new_path == parsed_url.path:161 if new_path == parsed_url.path:
162 msg = _('href %s does not contain version') % href162 msg = _('href %s does not contain version') % href
163163
=== modified file 'nova/api/openstack/zones.py'
--- nova/api/openstack/zones.py 2011-07-21 14:02:16 +0000
+++ nova/api/openstack/zones.py 2011-08-08 16:27:51 +0000
@@ -166,7 +166,7 @@
166 return self.helper._get_server_admin_password_old_style(server)166 return self.helper._get_server_admin_password_old_style(server)
167167
168168
169class ControllerV11(object):169class ControllerV11(Controller):
170 """Controller for 1.1 Zone resources."""170 """Controller for 1.1 Zone resources."""
171171
172 def _get_server_admin_password(self, server):172 def _get_server_admin_password(self, server):
173173
=== modified file 'nova/auth/novarc.template'
--- nova/auth/novarc.template 2011-06-08 18:16:10 +0000
+++ nova/auth/novarc.template 2011-08-08 16:27:51 +0000
@@ -16,3 +16,4 @@
16export NOVA_USERNAME="%(user)s"16export NOVA_USERNAME="%(user)s"
17export NOVA_PROJECT_ID="%(project)s"17export NOVA_PROJECT_ID="%(project)s"
18export NOVA_URL="%(os)s"18export NOVA_URL="%(os)s"
19export NOVA_VERSION="1.1"
1920
=== modified file 'nova/db/sqlalchemy/api.py'
--- nova/db/sqlalchemy/api.py 2011-08-05 19:28:22 +0000
+++ nova/db/sqlalchemy/api.py 2011-08-08 16:27:51 +0000
@@ -3307,7 +3307,7 @@
33073307
3308@require_context3308@require_context
3309def instance_type_extra_specs_get_item(context, instance_type_id, key,3309def instance_type_extra_specs_get_item(context, instance_type_id, key,
3310 session=None):3310 session=None):
3311 if not session:3311 if not session:
3312 session = get_session()3312 session = get_session()
33133313
33143314
=== modified file 'nova/flags.py'
--- nova/flags.py 2011-08-03 08:39:27 +0000
+++ nova/flags.py 2011-08-08 16:27:51 +0000
@@ -317,7 +317,7 @@
317DEFINE_string('osapi_host', '$my_ip', 'ip of api server')317DEFINE_string('osapi_host', '$my_ip', 'ip of api server')
318DEFINE_string('osapi_scheme', 'http', 'prefix for openstack')318DEFINE_string('osapi_scheme', 'http', 'prefix for openstack')
319DEFINE_integer('osapi_port', 8774, 'OpenStack API port')319DEFINE_integer('osapi_port', 8774, 'OpenStack API port')
320DEFINE_string('osapi_path', '/v1.0/', 'suffix for openstack')320DEFINE_string('osapi_path', '/v1.1/', 'suffix for openstack')
321DEFINE_integer('osapi_max_limit', 1000,321DEFINE_integer('osapi_max_limit', 1000,
322 'max number of items returned in a collection response')322 'max number of items returned in a collection response')
323323
324324
=== modified file 'nova/scheduler/api.py'
--- nova/scheduler/api.py 2011-07-01 13:44:12 +0000
+++ nova/scheduler/api.py 2011-08-08 16:27:51 +0000
@@ -17,7 +17,8 @@
17Handles all requests relating to schedulers.17Handles all requests relating to schedulers.
18"""18"""
1919
20import novaclient20from novaclient import v1_1 as novaclient
21from novaclient import exceptions as novaclient_exceptions
2122
22from nova import db23from nova import db
23from nova import exception24from nova import exception
@@ -112,7 +113,7 @@
112def _process(func, zone):113def _process(func, zone):
113 """Worker stub for green thread pool. Give the worker114 """Worker stub for green thread pool. Give the worker
114 an authenticated nova client and zone info."""115 an authenticated nova client and zone info."""
115 nova = novaclient.OpenStack(zone.username, zone.password, None,116 nova = novaclient.Client(zone.username, zone.password, None,
116 zone.api_url)117 zone.api_url)
117 nova.authenticate()118 nova.authenticate()
118 return func(nova, zone)119 return func(nova, zone)
@@ -132,10 +133,10 @@
132 zones = db.zone_get_all(context)133 zones = db.zone_get_all(context)
133 for zone in zones:134 for zone in zones:
134 try:135 try:
135 nova = novaclient.OpenStack(zone.username, zone.password, None,136 nova = novaclient.Client(zone.username, zone.password, None,
136 zone.api_url)137 zone.api_url)
137 nova.authenticate()138 nova.authenticate()
138 except novaclient.exceptions.BadRequest, e:139 except novaclient_exceptions.BadRequest, e:
139 url = zone.api_url140 url = zone.api_url
140 LOG.warn(_("Failed request to zone; URL=%(url)s: %(e)s")141 LOG.warn(_("Failed request to zone; URL=%(url)s: %(e)s")
141 % locals())142 % locals())
@@ -188,7 +189,7 @@
188 if method_name in ['find', 'findall']:189 if method_name in ['find', 'findall']:
189 try:190 try:
190 return getattr(manager, method_name)(**kwargs)191 return getattr(manager, method_name)(**kwargs)
191 except novaclient.NotFound:192 except novaclient_exceptions.NotFound:
192 url = zone.api_url193 url = zone.api_url
193 LOG.debug(_("%(collection)s.%(method_name)s didn't find "194 LOG.debug(_("%(collection)s.%(method_name)s didn't find "
194 "anything matching '%(kwargs)s' on '%(url)s'" %195 "anything matching '%(kwargs)s' on '%(url)s'" %
@@ -200,7 +201,7 @@
200 item = args.pop(0)201 item = args.pop(0)
201 try:202 try:
202 result = manager.get(item)203 result = manager.get(item)
203 except novaclient.NotFound:204 except novaclient_exceptions.NotFound:
204 url = zone.api_url205 url = zone.api_url
205 LOG.debug(_("%(collection)s '%(item)s' not found on '%(url)s'" %206 LOG.debug(_("%(collection)s '%(item)s' not found on '%(url)s'" %
206 locals()))207 locals()))
207208
=== modified file 'nova/scheduler/zone_aware_scheduler.py'
--- nova/scheduler/zone_aware_scheduler.py 2011-08-05 23:41:03 +0000
+++ nova/scheduler/zone_aware_scheduler.py 2011-08-08 16:27:51 +0000
@@ -24,7 +24,9 @@
24import json24import json
2525
26import M2Crypto26import M2Crypto
27import novaclient27
28from novaclient import v1_1 as novaclient
29from novaclient import exceptions as novaclient_exceptions
2830
29from nova import crypto31from nova import crypto
30from nova import db32from nova import db
@@ -118,10 +120,9 @@
118 % locals())120 % locals())
119 nova = None121 nova = None
120 try:122 try:
121 nova = novaclient.OpenStack(zone.username, zone.password, None,123 nova = novaclient.Client(zone.username, zone.password, None, url)
122 url)
123 nova.authenticate()124 nova.authenticate()
124 except novaclient.exceptions.BadRequest, e:125 except novaclient_exceptions.BadRequest, e:
125 raise exception.NotAuthorized(_("Bad credentials attempting "126 raise exception.NotAuthorized(_("Bad credentials attempting "
126 "to talk to zone at %(url)s.") % locals())127 "to talk to zone at %(url)s.") % locals())
127128
128129
=== modified file 'nova/scheduler/zone_manager.py'
--- nova/scheduler/zone_manager.py 2011-07-07 20:30:58 +0000
+++ nova/scheduler/zone_manager.py 2011-08-08 16:27:51 +0000
@@ -18,10 +18,11 @@
18"""18"""
1919
20import datetime20import datetime
21import novaclient
22import thread21import thread
23import traceback22import traceback
2423
24from novaclient import v1_1 as novaclient
25
25from eventlet import greenpool26from eventlet import greenpool
2627
27from nova import db28from nova import db
@@ -89,8 +90,8 @@
8990
90def _call_novaclient(zone):91def _call_novaclient(zone):
91 """Call novaclient. Broken out for testing purposes."""92 """Call novaclient. Broken out for testing purposes."""
92 client = novaclient.OpenStack(zone.username, zone.password, None,93 client = novaclient.Client(zone.username, zone.password, None,
93 zone.api_url)94 zone.api_url)
94 return client.zones.info()._info95 return client.zones.info()._info
9596
9697
9798
=== modified file 'nova/tests/scheduler/test_scheduler.py'
--- nova/tests/scheduler/test_scheduler.py 2011-08-03 21:08:22 +0000
+++ nova/tests/scheduler/test_scheduler.py 2011-08-08 16:27:51 +0000
@@ -21,9 +21,11 @@
2121
22import datetime22import datetime
23import mox23import mox
24import novaclient.exceptions
25import stubout24import stubout
2625
26from novaclient import v1_1 as novaclient
27from novaclient import exceptions as novaclient_exceptions
28
27from mox import IgnoreArg29from mox import IgnoreArg
28from nova import context30from nova import context
29from nova import db31from nova import db
@@ -1036,10 +1038,10 @@
10361038
1037class FakeEmptyServerCollection(object):1039class FakeEmptyServerCollection(object):
1038 def get(self, f):1040 def get(self, f):
1039 raise novaclient.NotFound(1)1041 raise novaclient_exceptions.NotFound(1)
10401042
1041 def find(self, name):1043 def find(self, name):
1042 raise novaclient.NotFound(2)1044 raise novaclient_exceptions.NotFound(2)
10431045
10441046
1045class FakeNovaClient(object):1047class FakeNovaClient(object):
@@ -1085,7 +1087,7 @@
1085 raise Exception('testing')1087 raise Exception('testing')
10861088
10871089
1088class FakeNovaClientOpenStack(object):1090class FakeNovaClientZones(object):
1089 def __init__(self, *args, **kwargs):1091 def __init__(self, *args, **kwargs):
1090 self.zones = FakeZonesProxy()1092 self.zones = FakeZonesProxy()
10911093
@@ -1098,7 +1100,7 @@
1098 super(CallZoneMethodTest, self).setUp()1100 super(CallZoneMethodTest, self).setUp()
1099 self.stubs = stubout.StubOutForTesting()1101 self.stubs = stubout.StubOutForTesting()
1100 self.stubs.Set(db, 'zone_get_all', zone_get_all)1102 self.stubs.Set(db, 'zone_get_all', zone_get_all)
1101 self.stubs.Set(novaclient, 'OpenStack', FakeNovaClientOpenStack)1103 self.stubs.Set(novaclient, 'Client', FakeNovaClientZones)
11021104
1103 def tearDown(self):1105 def tearDown(self):
1104 self.stubs.UnsetAll()1106 self.stubs.UnsetAll()
11051107
=== modified file 'nova/tests/test_zones.py'
--- nova/tests/test_zones.py 2011-07-07 19:55:34 +0000
+++ nova/tests/test_zones.py 2011-08-08 16:27:51 +0000
@@ -18,7 +18,6 @@
1818
19import datetime19import datetime
20import mox20import mox
21import novaclient
2221
23from nova import context22from nova import context
24from nova import db23from nova import db
2524
=== modified file 'tools/pip-requires'
--- tools/pip-requires 2011-08-02 19:03:33 +0000
+++ tools/pip-requires 2011-08-08 16:27:51 +0000
@@ -9,7 +9,7 @@
9carrot==0.10.59carrot==0.10.5
10eventlet10eventlet
11lockfile==0.811lockfile==0.8
12python-novaclient==2.5.912python-novaclient==2.6.0
13python-daemon==1.5.513python-daemon==1.5.5
14python-gflags==1.314python-gflags==1.3
15redis==2.0.015redis==2.0.0