Beispiel #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)
Beispiel #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)
Beispiel #3
0
 def _remove_local_file(self, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     shutil.rmtree(mountpoint)
Beispiel #4
0
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     return mountpoint, volmap.container_path
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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)
Beispiel #9
0
 def bind_mount(self, volume):
     mountpoint = mount.get_mountpoint(volume.volume_id)
     return mountpoint, volume.container_path
Beispiel #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)
Beispiel #11
0
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     return mountpoint, volmap.container_path
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #15
0
 def _remove_local_file(self, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     shutil.rmtree(mountpoint)