Coverage for ocp_resources/storage_profile.py: 0%

21 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 StorageProfile(Resource): 

7 """ 

8 StorageProfile Object 

9 

10 Doc: 

11 https://github.com/kubevirt/containerized-data-importer/blob/main/doc/storageprofile.md 

12 """ 

13 

14 def __init__(self, **kwargs): 

15 super().__init__(**kwargs) 

16 

17 api_group = Resource.ApiGroup.CDI_KUBEVIRT_IO 

18 

19 @property 

20 def claim_property_sets(self): 

21 return self.instance.status.get("claimPropertySets") 

22 

23 def first_claim_property_set_access_modes(self): 

24 return self.claim_property_sets[0].get("accessModes") if self.claim_property_sets else None 

25 

26 def first_claim_property_set_volume_mode(self): 

27 return self.claim_property_sets[0].get("volumeMode") if self.claim_property_sets else None 

28 

29 @property 

30 def clone_strategy(self): 

31 return self.instance.status.get("cloneStrategy") 

32 

33 @property 

34 def data_import_cron_source_format(self): 

35 return self.instance.status.get("dataImportCronSourceFormat") 

36 

37 @property 

38 def snapshotclass(self): 

39 return self.instance.status.get("snapshotClass")