Exemple #1
0
 def attach(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     fileutils.ensure_tree(mountpoint)
     filename = '/'.join([mountpoint, volmap.volume.uuid])
     with open(filename, 'wb') as fd:
         content = utils.decode_file_data(volmap.contents)
         fd.write(content)
Exemple #2
0
 def attach(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     fileutils.ensure_tree(mountpoint)
     filename = '/'.join([mountpoint, volmap.volume.uuid])
     with open(filename, 'wb') as fd:
         content = utils.decode_file_data(volmap.contents)
         fd.write(content)
Exemple #3
0
 def _remove_local_file(self, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     shutil.rmtree(mountpoint)
Exemple #4
0
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     return mountpoint, volmap.container_path
Exemple #5
0
 def _unmount_device(self, volmap):
     if hasattr(volmap, 'connection_info'):
         mountpoint = mount.get_mountpoint(volmap.volume.uuid)
         mount.do_unmount(mountpoint)
         shutil.rmtree(mountpoint)
Exemple #6
0
 def _mount_device(self, volmap, devpath):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     fileutils.ensure_tree(mountpoint)
     mount.do_mount(devpath, mountpoint, CONF.volume.fstype)
Exemple #7
0
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     filename = '/'.join([mountpoint, volmap.volume.uuid])
     return filename, volmap.container_path
Exemple #8
0
 def attach(self, context, volume):
     mountpoint = mount.get_mountpoint(volume.uuid)
     fileutils.ensure_tree(mountpoint)
     filename = '/'.join([mountpoint, volume.uuid])
     with open(filename, 'wb') as fd:
         fd.write(volume.contents)
Exemple #9
0
 def bind_mount(self, volume):
     mountpoint = mount.get_mountpoint(volume.volume_id)
     return mountpoint, volume.container_path
Exemple #10
0
 def _unmount_device(self, volume):
     conn_info = jsonutils.loads(volume.connection_info)
     devpath = conn_info['data']['device_path']
     mountpoint = mount.get_mountpoint(volume.volume_id)
     mount.do_unmount(devpath, mountpoint)
Exemple #11
0
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     return mountpoint, volmap.container_path
Exemple #12
0
 def _unmount_device(self, volmap):
     if hasattr(volmap, 'connection_info'):
         mountpoint = mount.get_mountpoint(volmap.volume.uuid)
         mount.do_unmount(mountpoint)
         shutil.rmtree(mountpoint)
Exemple #13
0
 def _mount_device(self, volmap, devpath):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     fileutils.ensure_tree(mountpoint)
     mount.do_mount(devpath, mountpoint, CONF.volume.fstype)
Exemple #14
0
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     filename = '/'.join([mountpoint, volmap.volume.uuid])
     return filename, volmap.container_path
Exemple #15
0
 def _remove_local_file(self, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     shutil.rmtree(mountpoint)