Code review comment for lp:~chmouel/nova/lp688032

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/

« Back to merge proposal