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/
« Back to merge proposal
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://