Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Commit

Permalink
Check container_format before spawning the instance
Browse files Browse the repository at this point in the history
  • Loading branch information
samalba committed Aug 25, 2013
1 parent 602fa14 commit e4e388d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nova-driver/driver.py
Expand Up @@ -19,7 +19,6 @@
A Docker Hypervisor which allows running Linux Containers instead of VMs.
"""

import base64
import os
import random
import socket
Expand Down Expand Up @@ -223,6 +222,11 @@ def _get_image_name(self, context, instance):
(image_service, image_id) = glance.get_remote_image_service(
context, instance['image_ref'])
image = image_service.show(context, image_id)
fmt = image['container_format']
if fmt != 'docker':
raise exception.InstanceDeployFailure(
'Image container format not supported ({0})'.format(fmt),
instance_id=instance['name'])
registry_port = self.docker.get_registry_port()
return '{0}:{1}/{2}'.format(CONF.get('my_ip'),
registry_port,
Expand Down

0 comments on commit e4e388d

Please sign in to comment.