diff options
| author | Rick Harris <rick.harris@rackspace.com> | 2011-02-25 16:24:51 +0000 |
|---|---|---|
| committer | Rick Harris <rick.harris@rackspace.com> | 2011-02-25 16:24:51 +0000 |
| commit | 079b532a1080da9fe5d99e90fa9c60d16506de06 (patch) | |
| tree | 95293571fd51a071146bcf32f92315c16d9e17ed | |
| parent | d27197ae53f3282280198d9bfe7f37a059fa8a35 (diff) | |
Verify status of image is active
| -rw-r--r-- | nova/api/openstack/servers.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index f51da0cdd..bf5663f60 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -358,6 +358,11 @@ class Controller(wsgi.Controller): # kernel_id and ramdisk_id image = self._image_service.show(req.environ['nova.context'], image_id) + if image['status'] != 'active': + raise exception.Invalid( + _("Cannot build from image %(image_id)s, status not active") % + locals()) + if image['type'] != 'machine': return None, None |
