示例#1
0
文件: driver.py 项目: Cerberus98/nova
 def copy_volume_to_image(self, context, volume, image_service, image_id):
     """Copy the volume to the specified image."""
     volume_path = self.local_path(volume)
     with utils.temporary_chown(volume_path):
         with utils.file_open(volume_path) as volume_file:
             image_service.update(context, image_id, {}, volume_file)
示例#2
0
 def copy_volume_to_image(self, context, volume, image_service, image_id):
     """Copy the volume to the specified image."""
     volume_path = self.local_path(volume)
     with utils.temporary_chown(volume_path):
         with utils.file_open(volume_path) as volume_file:
             image_service.update(context, image_id, {}, volume_file)
示例#3
0
文件: driver.py 项目: Cerberus98/nova
 def copy_image_to_volume(self, context, volume, image_service, image_id):
     """Fetch the image from image_service and write it to the volume."""
     volume_path = self.local_path(volume)
     with utils.temporary_chown(volume_path):
         with utils.file_open(volume_path, "wb") as image_file:
             image_service.download(context, image_id, image_file)
示例#4
0
 def copy_image_to_volume(self, context, volume, image_service, image_id):
     """Fetch the image from image_service and write it to the volume."""
     volume_path = self.local_path(volume)
     with utils.temporary_chown(volume_path):
         with utils.file_open(volume_path, "wb") as image_file:
             image_service.download(context, image_id, image_file)