Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
Signed-off-by: oviner <[email protected]>
  • Loading branch information
OdedViner committed Jun 26, 2024
1 parent 7b7c704 commit b4c1d49
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
9 changes: 7 additions & 2 deletions ocs_ci/utility/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def compare_versions(expression):

def get_dr_hub_operator_version(namespace="openshift"):
"""
Get DR Hub Opertaor Version
Get DR Hub Operator Version
Returns:
str: returns version string
Expand All @@ -176,10 +176,11 @@ def get_dr_hub_operator_version(namespace="openshift"):

def get_ocp_dr_cluster_operator_version(namespace="openshift"):
"""
Get DR Hub Opertaor Version
Get DR Hub Operator Version
Returns:
str: returns version string
"""
# Importing here to avoid circular dependency
from ocs_ci.ocs.resources.csv import get_csvs_start_with_prefix
Expand All @@ -197,6 +198,7 @@ def get_odf_multicluster_orchestrator_version(namespace=constants.ACM_HUB_NAMESP
Returns:
str: returns version string
"""
# Importing here to avoid circular dependency
from ocs_ci.ocs.resources.csv import get_csvs_start_with_prefix
Expand All @@ -220,6 +222,7 @@ def get_ocp_gitops_operator_version(namespace="openshift"):
Returns:
str: returns version string
"""
# Importing here to avoid circular dependency
from ocs_ci.ocs.resources.csv import get_csvs_start_with_prefix
Expand All @@ -239,6 +242,7 @@ def get_submariner_operator_version(namespace=constants.SUBMARINER_OPERATOR_NAME
Returns:
str: returns version string
"""
# Importing here to avoid circular dependency
from ocs_ci.ocs.resources.csv import get_csvs_start_with_prefix
Expand All @@ -256,6 +260,7 @@ def get_volsync_operator_version(namespace=constants.SUBMARINER_OPERATOR_NAMESPA
Returns:
str: returns version string
"""
# Importing here to avoid circular dependency
from ocs_ci.ocs.resources.csv import get_csvs_start_with_prefix
Expand Down
27 changes: 12 additions & 15 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@
skipif_ui_not_support,
run_cmd,
ceph_health_check_multi_storagecluster_external,
get_oadp_version,
get_acm_version,
)
from ocs_ci.helpers import helpers, dr_helpers
from ocs_ci.helpers.helpers import (
Expand All @@ -170,6 +172,14 @@
)
from ocs_ci.ocs.longevity import start_app_workload
from ocs_ci.utility.decorators import switch_to_default_cluster_index_at_last
from ocs_ci.utility.version import (
get_dr_hub_operator_version,
get_ocp_dr_cluster_operator_version,
get_odf_multicluster_orchestrator_version,
get_ocp_gitops_operator_version,
get_submariner_operator_version,
get_volsync_operator_version,
)

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -1591,20 +1601,7 @@ def additional_testsuite_properties(record_testsuite_property, pytestconfig):
# add markers as separated property
markers = ocsci_config.RUN["cli_params"].get("-m", "").replace(" ", "-")
record_testsuite_property("rp_markers", markers)
from ocs_ci.utility.version import (
get_dr_hub_operator_version,
get_ocp_dr_cluster_operator_version,
get_odf_multicluster_orchestrator_version,
get_ocp_gitops_operator_version,
get_submariner_operator_version,
get_volsync_operator_version,
)
from ocs_ci.utility.utils import (
get_oadp_version,
get_acm_version,
)

if ocsci_config.MULTICLUSTER["acm_cluster"]:
if ocsci_config.MULTICLUSTER.get("acm_cluster"):
acm_operator_version = get_acm_version()
if acm_operator_version:
record_testsuite_property("rp_acm_version", acm_operator_version)
Expand All @@ -1622,7 +1619,7 @@ def additional_testsuite_properties(record_testsuite_property, pytestconfig):
gitops_operator_version = get_ocp_gitops_operator_version()
if gitops_operator_version:
record_testsuite_property("rp_gitops_version", gitops_operator_version)
if ocsci_config.MULTICLUSTER["primary_cluster"]:
if ocsci_config.MULTICLUSTER.get("primary_cluster"):
oadp_operator_version = get_oadp_version()
if oadp_operator_version:
record_testsuite_property("rp_oadp_version", oadp_operator_version)
Expand Down

0 comments on commit b4c1d49

Please sign in to comment.