From 01363675884f155686836c4a372561cf9a59052b Mon Sep 17 00:00:00 2001 From: oviner Date: Wed, 24 Jul 2024 17:13:38 +0300 Subject: [PATCH] fix code Signed-off-by: oviner --- ocs_ci/ocs/resources/ocs.py | 10 ++++++++++ ocs_ci/ocs/utils.py | 5 +---- ocs_ci/utility/version.py | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ocs_ci/ocs/resources/ocs.py b/ocs_ci/ocs/resources/ocs.py index 168e5592eac..dcade8a8565 100644 --- a/ocs_ci/ocs/resources/ocs.py +++ b/ocs_ci/ocs/resources/ocs.py @@ -194,6 +194,16 @@ def __setstate__(self, d): def get_version_info(namespace=None): + """ + Get OCS versions and DR operator versions + + Args: + namespace (str): the CSVs namespace + + Returns: + dict: the ocs versions and DR operator versions + + """ operator_selector = get_selector_for_ocs_operator() subscription_plan_approval = config.DEPLOYMENT.get("subscription_plan_approval") package_manifest = PackageManifest( diff --git a/ocs_ci/ocs/utils.py b/ocs_ci/ocs/utils.py index c8ff18022ed..93099a96ea4 100644 --- a/ocs_ci/ocs/utils.py +++ b/ocs_ci/ocs/utils.py @@ -1735,16 +1735,13 @@ def get_dr_operator_versions(): versions_dic[ "odf_multicluster_orchestrator_version" ] = odf_multicluster_orchestrator_version - gitops_operator_version = get_ocp_gitops_operator_version() - if gitops_operator_version: - versions_dic["gitops_version"] = gitops_operator_version with ocsci_config.RunWithPrimaryConfigContext(): oadp_operator_version = get_oadp_version() if oadp_operator_version: versions_dic["oadp_version"] = oadp_operator_version ocp_dr_cluster_operator_version = get_ocp_dr_cluster_operator_version() if ocp_dr_cluster_operator_version: - versions_dic["ocp_dr_cluster_version"] = ocp_dr_cluster_operator_version + versions_dic["dr_cluster_version"] = ocp_dr_cluster_operator_version gitops_operator_version = get_ocp_gitops_operator_version() if gitops_operator_version: versions_dic["gitops_version"] = gitops_operator_version diff --git a/ocs_ci/utility/version.py b/ocs_ci/utility/version.py index d48f783a02d..ab916ac2dda 100644 --- a/ocs_ci/utility/version.py +++ b/ocs_ci/utility/version.py @@ -252,7 +252,7 @@ def get_ocp_gitops_operator_version(namespace=constants.OPENSHIFT_NAMESPACE): "openshift-gitops-operator", namespace=namespace ) for csv in csv_list: - if "openshift-gitops-operator" in csv["metadata"]["name"]: + if constants.GITOPS_OPERATOR_NAME in csv["metadata"]["name"]: # extract version string return csv["spec"]["version"]