def unstaging_the_volume(csi_instance, get_staged_volume, staged_volumes): volume = get_staged_volume csi_instance.node.NodeUnstageVolume( pb.NodeUnstageVolumeRequest( volume_id=volume.uuid, staging_target_path=volume.staging_target_path ) ) del staged_volumes[volume.uuid]
def staged_volumes(csi_instance): staged = {} yield staged for volume in staged.values(): csi_instance.node.NodeUnstageVolume( pb.NodeUnstageVolumeRequest( volume_id=volume.uuid, staging_target_path=volume.staging_target_path ) )
def test_stage_block_volume(csi_instance, volume_id, stage_context, staging_target_path, block_volume_capability): csi_instance.node.NodeStageVolume( pb.NodeStageVolumeRequest( volume_id=volume_id, publish_context=stage_context, staging_target_path=staging_target_path, volume_capability=block_volume_capability, secrets={}, volume_context={}, )) time.sleep(0.5) csi_instance.node.NodeUnstageVolume( pb.NodeUnstageVolumeRequest(volume_id=volume_id, staging_target_path=staging_target_path))
def staged_mount_volume( csi_instance, volume_id, stage_context, staging_target_path, stage_mount_volume_capability, ): csi_instance.node.NodeStageVolume( pb.NodeStageVolumeRequest( volume_id=volume_id, publish_context=stage_context, staging_target_path=staging_target_path, volume_capability=stage_mount_volume_capability, secrets={}, volume_context={}, )) yield csi_instance.node.NodeUnstageVolume( pb.NodeUnstageVolumeRequest(volume_id=volume_id, staging_target_path=staging_target_path))