Exemplo n.º 1
0
 def _get_binds(self, context, requested_volumes):
     binds = {}
     for volume in requested_volumes:
         volume_driver = vol_driver.driver(provider=volume.volume_provider,
                                           context=context)
         source, destination = volume_driver.bind_mount(volume)
         binds[source] = {'bind': destination}
     return binds
Exemplo n.º 2
0
 def __init__(self):
     super(DockerDriver, self).__init__()
     self._host = host.Host()
     self._get_host_storage_info()
     self.volume_driver = vol_driver.driver()
     self.image_drivers = {}
     for driver_name in CONF.image_driver_list:
         driver = img_driver.load_image_driver(driver_name)
         self.image_drivers[driver_name] = driver
Exemplo n.º 3
0
 def __init__(self):
     self.volume_drivers = {}
     for driver_name in CONF.volume.driver_list:
         driver = vol_driver.driver(driver_name)
         self.volume_drivers[driver_name] = driver
Exemplo n.º 4
0
 def is_volume_available(self, context, volume_mapping):
     volume_driver = vol_driver.driver(
         provider=volume_mapping.volume_provider, context=context)
     return volume_driver.is_volume_available(volume_mapping)
Exemplo n.º 5
0
 def delete_volume(self, context, volume_mapping):
     volume_driver = vol_driver.driver(
         provider=volume_mapping.volume_provider, context=context)
     volume_driver.delete(volume_mapping)
Exemplo n.º 6
0
 def attach_volume(self, context, volume_mapping):
     volume_driver = vol_driver.driver(
         provider=volume_mapping.volume_provider, context=context)
     volume_driver.attach(volume_mapping)