Beispiel #1
0
 def is_stale_attachment(self, dev, prefix):
     log.debug('Checking for stale attachment. dev: {0}, prefix: {1}'.format(dev, prefix))
     if dev in self.attached_block_devices(prefix) and not os_node_exists(dev):
         log.debug('{0} is stale, rejecting'.format(dev))
         return True
     log.debug('{0} not stale, using'.format(dev))
     return False
Beispiel #2
0
 def is_stale_attachment(self, dev, prefix):
     log.debug('Checking for stale attachment. dev: {0}, prefix: {1}'.format(dev, prefix))
     if dev in self.attached_block_devices(prefix) and not os_node_exists(dev):
         log.debug('{0} is stale, rejecting'.format(dev))
         return True
     log.debug('{0} not stale, using'.format(dev))
     return False
Beispiel #3
0
 def _volume_detached(self, blockdevice):
     status = self._volume.update()
     if status != 'available':
         raise VolumeException('Volume {0} not yet detached from {1}'.format(self._volume.id, self._instance.id))
     elif os_node_exists(blockdevice):
         raise VolumeException('Device node {0} still exists'.format(blockdevice))
     else:
         return True
Beispiel #4
0
 def _volume_attached(self, blockdevice):
     status = self._volume.update()
     if status != 'in-use':
         raise VolumeException('Volume {0} not yet attached to {1}:{2}'.format(self._volume.id, self._instance.id, blockdevice))
     elif not os_node_exists(blockdevice):
         raise VolumeException('{0} does not exist yet.'.format(blockdevice))
     else:
         return True
Beispiel #5
0
 def _volume_detached(self, blockdevice):
     status = self._volume.update()
     if status != 'available':
         raise VolumeException('Volume {0} not yet detached from {1}'.format(self._volume.id, self._instance.id))
     elif os_node_exists(blockdevice):
         raise VolumeException('Device node {0} still exists'.format(blockdevice))
     else:
         return True
Beispiel #6
0
 def _volume_attached(self, blockdevice):
     status = self._volume.update()
     if status != 'in-use':
         raise VolumeException('Volume {0} not yet attached to {1}:{2}'.format(self._volume.id, self._instance.id, blockdevice))
     elif not os_node_exists(blockdevice):
         raise VolumeException('{0} does not exist yet.'.format(blockdevice))
     else:
         return True