mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-07 17:40:30 +00:00
Set volume dev_path to None when detaching
This commit is contained in:
parent
2c20b593b4
commit
b67b8b7260
3 changed files with 4 additions and 2 deletions
|
@ -21,7 +21,7 @@ class LoopbackVolume(Volume):
|
|||
def _before_detach(self, e):
|
||||
log_check_call(['losetup', '--detach', self.loop_device_path])
|
||||
del self.loop_device_path
|
||||
del self.device_path
|
||||
self.device_path = None
|
||||
|
||||
def _before_delete(self, e):
|
||||
from os import remove
|
||||
|
|
|
@ -46,7 +46,7 @@ class QEMUVolume(LoopbackVolume):
|
|||
def _before_detach(self, e):
|
||||
log_check_call(['qemu-nbd', '--disconnect', self.loop_device_path])
|
||||
del self.loop_device_path
|
||||
del self.device_path
|
||||
self.device_path = None
|
||||
|
||||
def _module_loaded(self, module):
|
||||
import re
|
||||
|
|
|
@ -44,6 +44,8 @@ class EBSVolume(Volume):
|
|||
while self.volume.attachment_state() is not None:
|
||||
time.sleep(2)
|
||||
self.volume.update()
|
||||
del self.ec2_device_path
|
||||
self.device_path = None
|
||||
|
||||
def _before_delete(self, e):
|
||||
self.volume.delete()
|
||||
|
|
Loading…
Add table
Reference in a new issue