def copy_image_to_volume(self, context, volume, image_service, image_id): if image_utils.is_xenserver_image(context, image_service, image_id): return self._use_glance_plugin_to_copy_image_to_volume( context, volume, image_service, image_id) return self._use_image_utils_to_pipe_bytes_to_volume( context, volume, image_service, image_id)