@@ -129,6 +129,13 @@ def dynamic_infrastructure(self) -> bool:
129129 def cloud_infrastructure (self ) -> bool :
130130 return 'infrastructure' in self .config .sections ()
131131
132+ @property
133+ def csp (self ) -> str :
134+ """Cloud Service Provider."""
135+ if self .cloud_infrastructure :
136+ return self .capella_backend or self .cloud_provider
137+ return ""
138+
132139 @property
133140 def cloud_provider (self ) -> str :
134141 return self .config .get ('infrastructure' , 'provider' , fallback = '' )
@@ -737,15 +744,11 @@ def capella_admin_credentials(self) -> list[tuple[str, str]]:
737744 def parameters (self ) -> dict :
738745 from perfrunner .helpers .config_files import ClusterMetadataFile
739746
740- csp = ""
741- if self .cloud_infrastructure :
742- csp = self .capella_backend or self .cloud_provider
743-
744747 overrides = self ._get_options_as_dict ("parameters" )
745748 cluster_name = self .config .get (
746749 "metadata" , "cluster" , fallback = ClusterMetadataFile .DEFAULT_KEY_GROUP
747750 )
748- with ClusterMetadataFile (csp ) as metadata_file :
751+ with ClusterMetadataFile (self . csp ) as metadata_file :
749752 return metadata_file .get_parameters (cluster_name , overrides )
750753
751754 @property
@@ -2578,7 +2581,6 @@ class CbbackupmgrSettings:
25782581 ENCRYPTED = False
25792582 PASSPHRASE = "couchbase"
25802583 INCLUDE_DATA = None
2581- CLOUD = None
25822584
25832585 def __init__ (self , options : dict ):
25842586 self .threads = options .get ("threads" , self .THREADS )
@@ -2593,7 +2595,6 @@ def __init__(self, options: dict):
25932595 for kv in options .get ("env_vars" , "" ).replace (" " , "" ).split ("," )
25942596 if kv
25952597 )
2596- self .cloud = self .CLOUD
25972598
25982599
25992600class BackupSettings (CbbackupmgrSettings ):
@@ -2619,14 +2620,6 @@ def __init__(self, options: dict):
26192620 self .aws_credential_path = options .get ("aws_credential_path" , self .AWS_CREDENTIAL_PATH )
26202621 self .backup_directory = options .get ("backup_directory" , self .BACKUP_DIRECTORY )
26212622
2622- if self .backup_directory :
2623- if self .backup_directory .startswith ("s3://" ):
2624- self .cloud = "aws"
2625- elif self .backup_directory .startswith ("gs://" ):
2626- self .cloud = "gcp"
2627- elif self .backup_directory .startswith ("az://" ):
2628- self .cloud = "azure"
2629-
26302623
26312624class RestoreSettings (CbbackupmgrSettings ):
26322625 DOCS_PER_COLLECTION = 0
@@ -2645,17 +2638,9 @@ def __init__(self, options):
26452638 self .backup_repo = options .get ("backup_repo" , self .BACKUP_REPO )
26462639 self .import_file = options .get ("import_file" , self .IMPORT_FILE )
26472640 self .map_data = options .get ("map_data" , self .MAP_DATA )
2648- self .modify_storage_dir_name = bool (options .get ("modify_storage_dir_name " , 0 ))
2641+ self .use_csp_specific_archive = bool (options .get ("use_csp_specific_archive " , 0 ))
26492642 self .filter_keys = options .get ("filter_keys" , None )
26502643
2651- if self .backup_storage :
2652- if self .backup_storage .startswith ("s3://" ):
2653- self .cloud = "aws"
2654- elif self .backup_storage .startswith ("gs://" ):
2655- self .cloud = "gcp"
2656- elif self .backup_storage .startswith ("az://" ):
2657- self .cloud = "azure"
2658-
26592644 def __str__ (self ) -> str :
26602645 return str (self .__dict__ )
26612646
0 commit comments