Exemplo n.º 1
0
Arquivo: driver.py Projeto: wkite/zun
 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)
Exemplo n.º 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)
Exemplo n.º 3
0
Arquivo: driver.py Projeto: wkite/zun
 def _remove_local_file(self, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     shutil.rmtree(mountpoint)
Exemplo n.º 4
0
Arquivo: driver.py Projeto: wkite/zun
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     return mountpoint, volmap.container_path
Exemplo n.º 5
0
Arquivo: driver.py Projeto: wkite/zun
 def _unmount_device(self, volmap):
     if hasattr(volmap, 'connection_info'):
         mountpoint = mount.get_mountpoint(volmap.volume.uuid)
         mount.do_unmount(mountpoint)
         shutil.rmtree(mountpoint)
Exemplo n.º 6
0
Arquivo: driver.py Projeto: wkite/zun
 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)
Exemplo n.º 7
0
Arquivo: driver.py Projeto: wkite/zun
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     filename = '/'.join([mountpoint, volmap.volume.uuid])
     return filename, volmap.container_path
Exemplo n.º 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)
Exemplo n.º 9
0
 def bind_mount(self, volume):
     mountpoint = mount.get_mountpoint(volume.volume_id)
     return mountpoint, volume.container_path
Exemplo n.º 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)
Exemplo n.º 11
0
 def bind_mount(self, context, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     return mountpoint, volmap.container_path
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 15
0
 def _remove_local_file(self, volmap):
     mountpoint = mount.get_mountpoint(volmap.volume.uuid)
     shutil.rmtree(mountpoint)