Ejemplo n.º 1
0
 def NodeUnstageVolume(self, request, context):
     img_file = rawfile_util.img_file(request.volume_id)
     staging_path = request.staging_target_path
     staging_dev_path = Path(f"{staging_path}/dev")
     be_absent(staging_dev_path)
     detach_loops(img_file)
     return csi_pb2.NodeUnstageVolumeResponse()
Ejemplo n.º 2
0
    def NodeUnstageVolume(self, request, context):
        mount_path = f"{request.staging_target_path}/mount"
        be_unmounted(mount_path)
        be_absent(mount_path)

        bd_unpublish_request = NodeUnpublishVolumeRequest()
        bd_unpublish_request.volume_id = request.volume_id
        bd_unpublish_request.target_path = f"{request.staging_target_path}/device"
        self.bds.NodeUnpublishVolume(bd_unpublish_request, context)

        bd_unstage_request = NodeUnstageVolumeRequest()
        bd_unstage_request.CopyFrom(request)
        bd_unstage_request.staging_target_path = f"{request.staging_target_path}/block"
        self.bds.NodeUnstageVolume(bd_unstage_request, context)
        be_absent(bd_unstage_request.staging_target_path)

        return csi_pb2.NodeUnstageVolumeResponse()
Ejemplo n.º 3
0
def destroy(volume_id, dry_run=True):
    print(f"Destroying {volume_id}")
    if not dry_run:
        be_absent(img_file(volume_id))
        be_absent(meta_file(volume_id))
        be_absent(img_dir(volume_id))
Ejemplo n.º 4
0
 def NodeUnpublishVolume(self, request, context):
     target_path = request.target_path
     be_absent(path=target_path)
     return csi_pb2.NodeUnpublishVolumeResponse()
Ejemplo n.º 5
0
 def NodeUnpublishVolume(self, request, context):
     be_unmounted(request.target_path)
     be_absent(request.target_path)
     return csi_pb2.NodeUnpublishVolumeResponse()