diff --git a/ocs_ci/deployment/provider_client/storage_client_deployment.py b/ocs_ci/deployment/provider_client/storage_client_deployment.py index 2cc7c7a5b960..57d6a7e34da9 100644 --- a/ocs_ci/deployment/provider_client/storage_client_deployment.py +++ b/ocs_ci/deployment/provider_client/storage_client_deployment.py @@ -55,9 +55,16 @@ def initial_function(self): login_ui() self.validation_ui_obj = ValidationUI() self.ns_obj = ocp.OCP(kind=constants.NAMESPACES) - self.ns_obj.new_project( - project_name=constants.BM_DEBUG_NODE_NS, policy=constants.PSA_PRIVILEGED + + # Check constants.BM_DEBUG_NODE_NS is available or not + is_available = self.ns_obj.is_exist( + resource_name=constants.BM_DEBUG_NODE_NS, ) + + if not is_available: + self.ns_obj.new_project( + project_name=constants.BM_DEBUG_NODE_NS, policy=constants.PSA_PRIVILEGED + ) self.ocp_obj = ocp.OCP() self.storage_cluster_obj = ocp.OCP( kind="Storagecluster", namespace=config.ENV_DATA["cluster_namespace"] diff --git a/ocs_ci/helpers/managed_services.py b/ocs_ci/helpers/managed_services.py index cec807697a64..c53fdd148d9c 100644 --- a/ocs_ci/helpers/managed_services.py +++ b/ocs_ci/helpers/managed_services.py @@ -326,6 +326,7 @@ def get_all_storageclassclaims(namespace=None): else: sc_claim_obj = OCP(kind=constants.STORAGECLASSCLAIM, namespace=namespace) sc_claims_data = sc_claim_obj.get()["items"] + log.info(f"storage claims: {sc_claims_data}") return [OCS(**claim_data) for claim_data in sc_claims_data] diff --git a/ocs_ci/ocs/resources/storage_client.py b/ocs_ci/ocs/resources/storage_client.py index 67062cd2ea06..6d8c49d5ab50 100644 --- a/ocs_ci/ocs/resources/storage_client.py +++ b/ocs_ci/ocs/resources/storage_client.py @@ -286,6 +286,15 @@ def create_storageclaim( ) self.ocp_obj.exec_oc_cmd(f"apply -f {storage_classclaim_data_yaml.name}") + # def fetch_storageclaims( + # self, + # namespace=None, + + # ): + # """ + + # """ + def verify_storage_claim_status( self, storageclient_name=None, @@ -304,7 +313,6 @@ def verify_storage_claim_status( if not namespace: namespace = config.ENV_DATA["cluster_namespace"] sc_claims = get_all_storageclassclaims() - log.info(f"storage claims are {sc_claims}") for sc_claim in sc_claims: if self.ocs_version >= version.VERSION_4_16: if sc_claim.data["spec"]["storageClient"] == storageclient_name: @@ -333,7 +341,7 @@ def verify_storagerequest_exists( """ cmd = f"get storagerequests -n {namespace} " "-o=jsonpath='{.items[*]}'" - storage_requests = self.ocp_obj.exec_oc_cmd(command=cmd, out_yaml_format=True) + storage_requests = self.ocp_obj.exec_oc_cmd(command=cmd, out_yaml_format=False) log.info(f"The list of storagerequests: {storage_requests}") return ( @@ -494,8 +502,9 @@ def verify_native_storageclient(self): kind=constants.STORAGECLIENT, namespace=namespace, ) - storageclient = storageclient_obj.get()["items"][0] - storageclient_name = storageclient["metadata"]["name"] + storageclient_data = storageclient_obj.get()["items"] + log.info(f"storageclient data, {storageclient_data[0]}") + storageclient_name = storageclient_data[0]["metadata"]["name"] # Verify storageclient is in Connected status self.verify_storageclient_status(