Merge lp:~soren/nova/include-test-extensions into lp:~hudson-openstack/nova/trunk
- include-test-extensions
- Merge into trunk
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~soren/nova/include-test-extensions | ||||
Merge into: | lp:~hudson-openstack/nova/trunk | ||||
Diff against target: |
44 lines (+24/-2) 2 files modified
nova/api/openstack/extensions.py (+9/-2) nova/tests/api/openstack/extensions/__init__.py (+15/-0) |
||||
To merge this branch: | bzr merge lp:~soren/nova/include-test-extensions | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jay Pipes (community) | Approve | ||
Sandy Walsh (community) | Approve | ||
Review via email: mp+54869@code.launchpad.net |
This proposal has been superseded by a proposal from 2011-03-28.
Commit message
Toss an __init__ in the test extensions dir. This gets it included in the tarball.
Make extensions code ignore modules whose name starts with '_'.
Description of the change
OpenStack Infra (hudson-openstack) wrote : | # |
The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.
AccountsTest
test_
test_
test_
test_
AdminAPITest
test_
test_
APITest
test_
Test
test_
test_
test_bad_token OK
test_
test_
test_no_user OK
test_
TestFunctional
test_
test_
TestLimiter
test_
LimiterTest
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
ActionExtensionTest
test_
test_
test_
ExtensionContro
test_
test_index ERROR
ExtensionManage
test_
ResourceExtensi
test_
test_
test_
ResponseExtensi
test_
test_
TestFaults
test_
test_raise ...
Soren Hansen (soren) wrote : | # |
:(
OpenStack Infra (hudson-openstack) wrote : | # |
The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.
AccountsTest
test_
test_
test_
test_
AdminAPITest
test_
test_
APITest
test_
Test
test_
test_
test_bad_token OK
test_
test_
test_no_user OK
test_
TestFunctional
test_
test_
TestLimiter
test_
LimiterTest
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
ActionExtensionTest
test_
test_
test_
ExtensionContro
test_
test_index ERROR
ExtensionManage
test_
ResourceExtensi
test_
test_
test_
ResponseExtensi
test_
test_
TestFaults
test_
test_raise ...
OpenStack Infra (hudson-openstack) wrote : | # |
The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.
AccountsTest
test_
test_
test_
test_
AdminAPITest
test_
test_
APITest
test_
Test
test_
test_
test_bad_token OK
test_
test_
test_no_user OK
test_
TestFunctional
test_
test_
TestLimiter
test_
LimiterTest
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
ActionExtensionTest
test_
test_
test_
ExtensionContro
test_
test_index ERROR
ExtensionManage
test_
ResourceExtensi
test_
test_
test_
ResponseExtensi
test_
test_
TestFaults
test_
test_raise ...
Soren Hansen (soren) wrote : | # |
This makes *no* sense to me.
OpenStack Infra (hudson-openstack) wrote : | # |
The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.
AccountsTest
test_
test_
test_
test_
AdminAPITest
test_
test_
APITest
test_
Test
test_
test_
test_bad_token OK
test_
test_
test_no_user OK
test_
TestFunctional
test_
test_
TestLimiter
test_
LimiterTest
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
ActionExtensionTest
test_
test_
test_
ExtensionContro
test_
test_index ERROR
ExtensionManage
test_
ResourceExtensi
test_
test_
test_
ResponseExtensi
test_
test_
TestFaults
test_
test_raise ...
Soren Hansen (soren) wrote : | # |
Stab in the dark: Added contents (license and copyright) to the file. Trying again.
OpenStack Infra (hudson-openstack) wrote : | # |
The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.
AccountsTest
test_
test_
test_
test_
AdminAPITest
test_
test_
APITest
test_
Test
test_
test_
test_bad_token OK
test_
test_
test_no_user OK
test_
TestFunctional
test_
test_
TestLimiter
test_
LimiterTest
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
ActionExtensionTest
test_
test_
test_
ExtensionContro
test_
test_index ERROR
ExtensionManage
test_
ResourceExtensi
test_
test_
test_
ResponseExtensi
test_
test_
TestFaults
test_
test_raise ...
termie (termie) wrote : | # |
neat bug
Soren Hansen (soren) wrote : | # |
Ok, I *swear* I ran the test suite before uploading this. I'm *almost*
sure I even ran it in the right directory.
- 890. By Soren Hansen
-
Add friendlier message if an extension fails to include a correctly named class or factory.
- 891. By Soren Hansen
-
Spell "warn" correctly.
- 892. By Soren Hansen
-
Remove now useless try/except block.
- 893. By Soren Hansen
-
pep8
Unmerged revisions
Preview Diff
1 | === modified file 'nova/api/openstack/extensions.py' |
2 | --- nova/api/openstack/extensions.py 2011-03-21 18:00:39 +0000 |
3 | +++ nova/api/openstack/extensions.py 2011-03-28 13:26:08 +0000 |
4 | @@ -317,11 +317,18 @@ |
5 | LOG.audit(_('Loading extension file: %s'), f) |
6 | mod_name, file_ext = os.path.splitext(os.path.split(f)[-1]) |
7 | ext_path = os.path.join(self.path, f) |
8 | - if file_ext.lower() == '.py': |
9 | + if file_ext.lower() == '.py' and not mod_name.startswith('_'): |
10 | mod = imp.load_source(mod_name, ext_path) |
11 | ext_name = mod_name[0].upper() + mod_name[1:] |
12 | try: |
13 | - new_ext = getattr(mod, ext_name)() |
14 | + new_ext_class = getattr(mod, ext_name, None) |
15 | + if not new_ext_class: |
16 | + LOG.warning(_('Did not find expected name ' |
17 | + '"%(ext_name)" in %(file)s'), |
18 | + { 'ext_name': ext_name, |
19 | + 'file': ext_path }) |
20 | + continue |
21 | + new_ext = new_ext_class() |
22 | self._check_extension(new_ext) |
23 | self.extensions[new_ext.get_alias()] = new_ext |
24 | except AttributeError as ex: |
25 | |
26 | === added file 'nova/tests/api/openstack/extensions/__init__.py' |
27 | --- nova/tests/api/openstack/extensions/__init__.py 1970-01-01 00:00:00 +0000 |
28 | +++ nova/tests/api/openstack/extensions/__init__.py 2011-03-28 13:26:08 +0000 |
29 | @@ -0,0 +1,15 @@ |
30 | +# vim: tabstop=4 shiftwidth=4 softtabstop=4 |
31 | + |
32 | +# Copyright 2011 OpenStack LLC |
33 | +# |
34 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may |
35 | +# not use this file except in compliance with the License. You may obtain |
36 | +# a copy of the License at |
37 | +# |
38 | +# http://www.apache.org/licenses/LICENSE-2.0 |
39 | +# |
40 | +# Unless required by applicable law or agreed to in writing, software |
41 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
42 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
43 | +# License for the specific language governing permissions and limitations |
44 | +# under the License. |
sure