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 |
Related bugs: |
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.
2010/12/9 Chmouel Boudjnah <email address hidden>: instance_ types.py' instance_ types.py 2010-11-24 22:52:10 +0000 instance_ types.py 2010-12-09 13:48:57 +0000 instance_ type ApiError( "Unknown instance type: %s",
> === modified file 'nova/compute/
> --- nova/compute/
> +++ nova/compute/
> @@ -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_
> if instance_type not in INSTANCE_TYPES:
> - raise exception.
> - 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.
-- www.ubuntu. com/ www.openstack. org/
Soren Hansen
Ubuntu Developer http://
OpenStack Developer http://