Merge lp:~soren/nova/include-test-extensions into lp:~hudson-openstack/nova/trunk

Proposed by Soren Hansen
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
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 '_'.

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

sure

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

lgtm.

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (86.3 KiB)

The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.

AccountsTest
    test_account_create OK
    test_account_delete OK
    test_account_update OK
    test_get_account OK
AdminAPITest
    test_admin_disabled OK
    test_admin_enabled OK
APITest
    test_exceptions_are_converted_to_faults OK
Test
    test_authorize_token OK
    test_authorize_user OK
    test_bad_token OK
    test_bad_user_bad_key OK
    test_bad_user_good_key OK
    test_no_user OK
    test_token_expiry OK
TestFunctional
    test_token_doesnotexist OK
    test_token_expiry OK
TestLimiter
    test_authorize_token OK
LimiterTest
    test_limiter_custom_max_limit OK
    test_limiter_limit_and_offset OK
    test_limiter_limit_medium OK
    test_limiter_limit_over_max OK
    test_limiter_limit_zero OK
    test_limiter_negative_limit OK
    test_limiter_negative_offset OK
    test_limiter_nothing OK
    test_limiter_offset_bad OK
    test_limiter_offset_blank OK
    test_limiter_offset_medium OK
    test_limiter_offset_over_max OK
    test_limiter_offset_zero OK
ActionExtensionTest
    test_extended_action ERROR
    test_invalid_action ERROR
    test_invalid_action_body ERROR
ExtensionControllerTest
    test_get_by_alias ERROR
    test_index ERROR
ExtensionManagerTest
    test_get_resources ERROR
ResourceExtensionTest
    test_get_resources OK
    test_get_resources_with_controller OK
    test_no_extension_present OK
ResponseExtensionTest
    test_get_resources_with_mgr ERROR
    test_get_resources_with_stub_mgr OK
TestFaults
    test_fault_parts OK
    test_raise ...

Revision history for this message
Soren Hansen (soren) wrote :

:(

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (87.0 KiB)

The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.

AccountsTest
    test_account_create OK
    test_account_delete OK
    test_account_update OK
    test_get_account OK
AdminAPITest
    test_admin_disabled OK
    test_admin_enabled OK
APITest
    test_exceptions_are_converted_to_faults OK
Test
    test_authorize_token OK
    test_authorize_user OK
    test_bad_token OK
    test_bad_user_bad_key OK
    test_bad_user_good_key OK
    test_no_user OK
    test_token_expiry OK
TestFunctional
    test_token_doesnotexist OK
    test_token_expiry OK
TestLimiter
    test_authorize_token OK
LimiterTest
    test_limiter_custom_max_limit OK
    test_limiter_limit_and_offset OK
    test_limiter_limit_medium OK
    test_limiter_limit_over_max OK
    test_limiter_limit_zero OK
    test_limiter_negative_limit OK
    test_limiter_negative_offset OK
    test_limiter_nothing OK
    test_limiter_offset_bad OK
    test_limiter_offset_blank OK
    test_limiter_offset_medium OK
    test_limiter_offset_over_max OK
    test_limiter_offset_zero OK
ActionExtensionTest
    test_extended_action ERROR
    test_invalid_action ERROR
    test_invalid_action_body ERROR
ExtensionControllerTest
    test_get_by_alias ERROR
    test_index ERROR
ExtensionManagerTest
    test_get_resources ERROR
ResourceExtensionTest
    test_get_resources OK
    test_get_resources_with_controller OK
    test_no_extension_present OK
ResponseExtensionTest
    test_get_resources_with_mgr ERROR
    test_get_resources_with_stub_mgr OK
TestFaults
    test_fault_parts OK
    test_raise ...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (87.2 KiB)

The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.

AccountsTest
    test_account_create OK
    test_account_delete OK
    test_account_update OK
    test_get_account OK
AdminAPITest
    test_admin_disabled OK
    test_admin_enabled OK
APITest
    test_exceptions_are_converted_to_faults OK
Test
    test_authorize_token OK
    test_authorize_user OK
    test_bad_token OK
    test_bad_user_bad_key OK
    test_bad_user_good_key OK
    test_no_user OK
    test_token_expiry OK
TestFunctional
    test_token_doesnotexist OK
    test_token_expiry OK
TestLimiter
    test_authorize_token OK
LimiterTest
    test_limiter_custom_max_limit OK
    test_limiter_limit_and_offset OK
    test_limiter_limit_medium OK
    test_limiter_limit_over_max OK
    test_limiter_limit_zero OK
    test_limiter_negative_limit OK
    test_limiter_negative_offset OK
    test_limiter_nothing OK
    test_limiter_offset_bad OK
    test_limiter_offset_blank OK
    test_limiter_offset_medium OK
    test_limiter_offset_over_max OK
    test_limiter_offset_zero OK
ActionExtensionTest
    test_extended_action ERROR
    test_invalid_action ERROR
    test_invalid_action_body ERROR
ExtensionControllerTest
    test_get_by_alias ERROR
    test_index ERROR
ExtensionManagerTest
    test_get_resources ERROR
ResourceExtensionTest
    test_get_resources OK
    test_get_resources_with_controller OK
    test_no_extension_present OK
ResponseExtensionTest
    test_get_resources_with_mgr ERROR
    test_get_resources_with_stub_mgr OK
TestFaults
    test_fault_parts OK
    test_raise ...

Revision history for this message
Soren Hansen (soren) wrote :

This makes *no* sense to me.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (87.5 KiB)

The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.

AccountsTest
    test_account_create OK
    test_account_delete OK
    test_account_update OK
    test_get_account OK
AdminAPITest
    test_admin_disabled OK
    test_admin_enabled OK
APITest
    test_exceptions_are_converted_to_faults OK
Test
    test_authorize_token OK
    test_authorize_user OK
    test_bad_token OK
    test_bad_user_bad_key OK
    test_bad_user_good_key OK
    test_no_user OK
    test_token_expiry OK
TestFunctional
    test_token_doesnotexist OK
    test_token_expiry OK
TestLimiter
    test_authorize_token OK
LimiterTest
    test_limiter_custom_max_limit OK
    test_limiter_limit_and_offset OK
    test_limiter_limit_medium OK
    test_limiter_limit_over_max OK
    test_limiter_limit_zero OK
    test_limiter_negative_limit OK
    test_limiter_negative_offset OK
    test_limiter_nothing OK
    test_limiter_offset_bad OK
    test_limiter_offset_blank OK
    test_limiter_offset_medium OK
    test_limiter_offset_over_max OK
    test_limiter_offset_zero OK
ActionExtensionTest
    test_extended_action ERROR
    test_invalid_action ERROR
    test_invalid_action_body ERROR
ExtensionControllerTest
    test_get_by_alias ERROR
    test_index ERROR
ExtensionManagerTest
    test_get_resources ERROR
ResourceExtensionTest
    test_get_resources OK
    test_get_resources_with_controller OK
    test_no_extension_present OK
ResponseExtensionTest
    test_get_resources_with_mgr ERROR
    test_get_resources_with_stub_mgr OK
TestFaults
    test_fault_parts OK
    test_raise ...

Revision history for this message
Soren Hansen (soren) wrote :

Stab in the dark: Added contents (license and copyright) to the file. Trying again.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (87.5 KiB)

The attempt to merge lp:~soren/nova/include-test-extensions into lp:nova failed. Below is the output from the failed tests.

AccountsTest
    test_account_create OK
    test_account_delete OK
    test_account_update OK
    test_get_account OK
AdminAPITest
    test_admin_disabled OK
    test_admin_enabled OK
APITest
    test_exceptions_are_converted_to_faults OK
Test
    test_authorize_token OK
    test_authorize_user OK
    test_bad_token OK
    test_bad_user_bad_key OK
    test_bad_user_good_key OK
    test_no_user OK
    test_token_expiry OK
TestFunctional
    test_token_doesnotexist OK
    test_token_expiry OK
TestLimiter
    test_authorize_token OK
LimiterTest
    test_limiter_custom_max_limit OK
    test_limiter_limit_and_offset OK
    test_limiter_limit_medium OK
    test_limiter_limit_over_max OK
    test_limiter_limit_zero OK
    test_limiter_negative_limit OK
    test_limiter_negative_offset OK
    test_limiter_nothing OK
    test_limiter_offset_bad OK
    test_limiter_offset_blank OK
    test_limiter_offset_medium OK
    test_limiter_offset_over_max OK
    test_limiter_offset_zero OK
ActionExtensionTest
    test_extended_action ERROR
    test_invalid_action ERROR
    test_invalid_action_body ERROR
ExtensionControllerTest
    test_get_by_alias ERROR
    test_index ERROR
ExtensionManagerTest
    test_get_resources ERROR
ResourceExtensionTest
    test_get_resources OK
    test_get_resources_with_controller OK
    test_no_extension_present OK
ResponseExtensionTest
    test_get_resources_with_mgr ERROR
    test_get_resources_with_stub_mgr OK
TestFaults
    test_fault_parts OK
    test_raise ...

Revision history for this message
termie (termie) wrote :

neat bug

Revision history for this message
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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.