Merge lp:~chmouel/nova/lp688032 into lp:~hudson-openstack/nova/trunk

Proposed by Chmouel Boudjnah
Status: Merged
Approved by: Jay Pipes
Approved revision: 455
Merged at revision: 457
Proposed branch: lp:~chmouel/nova/lp688032
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 31 lines (+3/-2)
2 files modified
Authors (+1/-0)
nova/compute/instance_types.py (+2/-2)
To merge this branch: bzr merge lp:~chmouel/nova/lp688032
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Soren Hansen (community) Approve
Review via email: mp+43211@code.launchpad.net

Commit message

Fix exception throwing with wrong instance type.

To post a comment you must log in.
Revision history for this message
Soren Hansen (soren) wrote :

2010/12/9 Chmouel Boudjnah <email address hidden>:
> === modified file 'nova/compute/instance_types.py'
> --- nova/compute/instance_types.py      2010-11-24 22:52:10 +0000
> +++ nova/compute/instance_types.py      2010-12-09 13:48:57 +0000
> @@ -22,6 +22,7 @@
>  """
>
>  from nova import flags
> +from nova.exception import ApiError
>
>  FLAGS = flags.FLAGS
>  INSTANCE_TYPES = {
> @@ -37,8 +38,7 @@
>     if instance_type is None:
>         return FLAGS.default_instance_type
>     if instance_type not in INSTANCE_TYPES:
> -        raise exception.ApiError("Unknown instance type: %s",
> -                                 instance_type)
> +        raise ApiError("Unknown instance type: %s" % instance_type)
>     return instance_type

Please just do "from nova import exception". We generally don't import
classes, only modules.

--
Soren Hansen
Ubuntu Developer    http://www.ubuntu.com/
OpenStack Developer http://www.openstack.org/

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

Agreed with Soren. Just do the import. We can get this merged quickly after that.. :)

review: Needs Fixing
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

yeah i have fixed it in my branch, how do i request for merging again ?

On 11 Dec 2010, at 20:54, Jay Pipes wrote:

> Review: Needs Fixing
> Agreed with Soren. Just do the import. We can get this merged quickly after that.. :)
> --
> https://code.launchpad.net/~chmouel/nova/lp688032/+merge/43211
> You are the owner of lp:~chmouel/nova/lp688032.

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

No need to submit again. Lgtm.

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

Chmouel, did you bzr push that branch again? I don't see the change...

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

Den 12/12/2010 16.46 skrev "Jay Pipes" <email address hidden>:
> Chmouel, did you bzr push that branch again? I don't see the change...

What do you mean? do you not see it when you look at the diff on launchpad
or just that you didn't get an email with the new diff?

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

Oh, duh. I saw the two changed areas in the diff and assumed the patch had not been pushed... you know what they say about assumptions... ;)

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

The attempt to merge lp:~chmouel/nova/lp688032 into lp:nova failed. Below is the output from the failed tests.

nova.tests.access_unittest
  AccessTestCase
    test_001_allow_all ... [OK]
    test_002_allow_none ... [OK]
    test_003_allow_project_manager ... [OK]
    test_004_allow_sys_and_net ... [OK]
nova.tests.api_unittest
  ApiEc2TestCase
    test_authorize_revoke_security_group_cidr ... [OK]
    test_authorize_revoke_security_group_foreign_group ... [OK]
    test_create_delete_security_group ... [OK]
    test_describe_instances ... [OK]
    test_get_all_key_pairs ... [OK]
    test_get_all_security_groups ... [OK]
  XmlConversionTestCase
    test_number_conversion ... [OK]
nova.tests.auth_unittest
  AuthManagerDbTestCase
    test_004_signature_is_valid ... [OK]
    test_005_can_get_credentials ... [OK]
    test_add_user_role_doesnt_infect_project_roles ... [OK]
    test_adding_role_to_project_is_ignored_unless_added_to_user ... [OK]
    test_can_add_and_remove_user_role ... [OK]
    test_can_add_remove_user_with_role ... [OK]
    test_can_add_user_to_project ... [OK]
    test_can_create_and_get_project ... [OK]
    test_can_create_and_get_project_with_attributes ... [OK]
    test_can_create_project_with_manager ... [OK]
    test_can_delete_project ... [OK]
    test_can_delete_user ... [OK]
    test_can_generate_x509 ... [OK]
    test_can_list_project_roles ... [OK]
    test_can_list_projects ... [OK]
    test_can_list_user_roles ... [OK]
    test_can_list_users ... [OK]
    test_can_modify_project ... [OK]
    test_can_modify_users ... [OK]
    test_can_remove_project_role_but_keep_user_role ... [OK]
    test_can_remove_user_from_project ... [OK]
    test_can_remove_user_roles ... [OK]
    test_can_retrieve_project_by_user ... [OK]
    test_create_and_find_user ... [OK]
    test_create_and_find_with_properties ... [OK]
    test_create_project_assigns_manager_to_members...

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

Chmouel, looks like you need to add your name to the AUTHORS file :) Welcome aboard!

lp:~chmouel/nova/lp688032 updated
455. By Chmouel Boudjnah

Add myself.

Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

hey hey great :-), I have just pushed the change to the author file to my
branch and it should pick up.

Chmouel.

On 13 December 2010 16:13, Jay Pipes <email address hidden> wrote:

> Chmouel, looks like you need to add your name to the AUTHORS file :)
> Welcome aboard!
> --
> https://code.launchpad.net/~chmouel/nova/lp688032/+merge/43211
> You are the owner of lp:~chmouel/nova/lp688032.
>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Authors'
2--- Authors 2010-12-09 14:22:50 +0000
3+++ Authors 2010-12-13 18:58:26 +0000
4@@ -3,6 +3,7 @@
5 Anthony Young <sleepsonthefloor@gmail.com>
6 Armando Migliaccio <Armando.Migliaccio@eu.citrix.com>
7 Chris Behrens <cbehrens@codestud.com>
8+Chmouel Boudjnah <chmouel@chmouel.com>
9 Dean Troyer <dtroyer@gmail.com>
10 Devin Carlen <devin.carlen@gmail.com>
11 Eric Day <eday@oddments.org>
12
13=== modified file 'nova/compute/instance_types.py'
14--- nova/compute/instance_types.py 2010-11-24 22:52:10 +0000
15+++ nova/compute/instance_types.py 2010-12-13 18:58:26 +0000
16@@ -22,6 +22,7 @@
17 """
18
19 from nova import flags
20+from nova import exception
21
22 FLAGS = flags.FLAGS
23 INSTANCE_TYPES = {
24@@ -37,8 +38,7 @@
25 if instance_type is None:
26 return FLAGS.default_instance_type
27 if instance_type not in INSTANCE_TYPES:
28- raise exception.ApiError("Unknown instance type: %s",
29- instance_type)
30+ raise exception.ApiError("Unknown instance type: %s" % instance_type)
31 return instance_type
32
33