Coverage for ocp_resources/persistent_volume.py: 0%

8 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-30 10:48 +0200

1# -*- coding: utf-8 -*- 

2 

3from ocp_resources.resource import Resource 

4 

5 

6class PersistentVolume(Resource): 

7 """ 

8 PersistentVolume object 

9 """ 

10 

11 api_version = Resource.ApiVersion.V1 

12 

13 class Status(Resource.Status): 

14 RELEASED = "Released" 

15 

16 @property 

17 def max_available_pvs(self): 

18 """ 

19 Returns the maximum number (int) of PV's which are in 'Available' state 

20 """ 

21 return len([pv for pv in self.api.get()["items"] if pv.status.phase == Resource.Condition.AVAILABLE])