def test_clone_image_success(self):
context = {}
- image_location = ('sheepdog:192.168.1.111:7000:Alice', None)
image_id = "caa4ffd0-fake-fake-fake-f8631a807f5a"
+ image_location = ('sheepdog://192.168.1.111:7000:%s' % image_id, None)
image_meta = {'id': image_id, 'size': 1, 'disk_format': 'raw'}
image_service = ''
def test_is_cloneable(self):
uuid = '87f1b01c-f46c-4537-bd5d-23962f5f4316'
- location = 'sheepdog:ip:port:%s' % uuid
+ location = 'sheepdog://ip:port:%s' % uuid
image_meta = {'id': uuid, 'size': 1, 'disk_format': 'raw'}
invalid_image_meta = {'id': uuid, 'size': 1, 'disk_format': 'iso'}
if image_location is None:
return False
- if not image_location.startswith("sheepdog:"):
+ prefix = 'sheepdog://'
+ if not image_location.startswith(prefix):
LOG.debug("Image is not stored in sheepdog.")
return False
# check whether volume is stored in sheepdog
try:
# The image location would be like
- # "sheepdog:192.168.10.2:7000:Alice"
- (label, ip, port, name) = image_location.split(":", 3)
+ # "sheepdog://192.168.10.2:7000:Alice"
+ (ip, port, name) = image_location[len(prefix):].split(":", 2)
self._try_execute('collie', 'vdi', 'list', '--address', ip,
'--port', port, name)
if not self._is_cloneable(image_location, image_meta):
return {}, False
- # The image location would be like
- # "sheepdog:192.168.10.2:7000:Alice"
- (label, ip, port, name) = image_location.split(":", 3)
- volume_ref = {'name': name, 'size': image_meta['size']}
+ volume_ref = {'name': image_meta['id'], 'size': image_meta['size']}
self.create_cloned_volume(volume, volume_ref)
self.client.resize(volume.name, volume.size)