From 32b611b2a6498b1de307142e335e09d1e0ec082c Mon Sep 17 00:00:00 2001 From: Valerii Ponomarov Date: Thu, 7 Mar 2019 20:30:44 +0530 Subject: Reorder lib files removing redundant dir layer Move all the files of 'cns-libs/cnslibs/common' dir to the 'openshift-storage-libs/openshiftstoragelibs', because 'common' is the only dir there, which doesn't really makes sense. And "cns" is old project name, so, replace it with "openshift-storage-libs". Also, fix all the imports of these libs. Change-Id: Ife00a73554e73b21b214b15016b0c8dbbf423446 --- .../functional/heketi/test_block_volumes_heketi.py | 16 +++++------ tests/functional/heketi/test_check_brick_paths.py | 10 ++++--- ...est_create_distributed_replica_heketi_volume.py | 26 ++++++++++-------- tests/functional/heketi/test_device_info.py | 4 +-- tests/functional/heketi/test_disabling_device.py | 8 +++--- .../functional/heketi/test_heketi_create_volume.py | 30 ++++++++++---------- .../heketi/test_heketi_device_operations.py | 32 ++++++++++++---------- tests/functional/heketi/test_heketi_metrics.py | 18 ++++++------ .../heketi/test_heketi_volume_operations.py | 12 ++++---- .../functional/heketi/test_node_enable_disable.py | 18 ++++++------ tests/functional/heketi/test_node_info.py | 4 +-- .../heketi/test_server_state_examine_gluster.py | 8 +++--- tests/functional/heketi/test_volume_creation.py | 8 +++--- tests/functional/heketi/test_volume_deletion.py | 6 ++-- .../heketi/test_volume_expansion_and_devices.py | 9 ++++-- tests/functional/heketi/test_volume_multi_req.py | 22 +++++++++------ 16 files changed, 126 insertions(+), 105 deletions(-) (limited to 'tests/functional/heketi') diff --git a/tests/functional/heketi/test_block_volumes_heketi.py b/tests/functional/heketi/test_block_volumes_heketi.py index b75f58ac..62f90500 100644 --- a/tests/functional/heketi/test_block_volumes_heketi.py +++ b/tests/functional/heketi/test_block_volumes_heketi.py @@ -1,11 +1,11 @@ - -from cnslibs.common.heketi_ops import (heketi_blockvolume_create, - heketi_blockvolume_delete, - heketi_blockvolume_list, - heketi_volume_create, - heketi_volume_delete - ) -from cnslibs.common.baseclass import BaseClass +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.heketi_ops import ( + heketi_blockvolume_create, + heketi_blockvolume_delete, + heketi_blockvolume_list, + heketi_volume_create, + heketi_volume_delete, +) class TestBlockVolumeOps(BaseClass): diff --git a/tests/functional/heketi/test_check_brick_paths.py b/tests/functional/heketi/test_check_brick_paths.py index 1b5aa32d..3c8aa6df 100644 --- a/tests/functional/heketi/test_check_brick_paths.py +++ b/tests/functional/heketi/test_check_brick_paths.py @@ -1,9 +1,11 @@ from glusto.core import Glusto as g -from cnslibs.common.baseclass import BaseClass -from cnslibs.common.heketi_ops import (heketi_volume_create, - heketi_volume_delete) -from cnslibs.common import openshift_ops +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.heketi_ops import ( + heketi_volume_create, + heketi_volume_delete, +) +from openshiftstoragelibs import openshift_ops class TestHeketiVolume(BaseClass): diff --git a/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py b/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py index 93ef0593..04bce628 100644 --- a/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py +++ b/tests/functional/heketi/test_create_distributed_replica_heketi_volume.py @@ -4,18 +4,20 @@ import math from glusto.core import Glusto as g from glustolibs.gluster.volume_ops import get_volume_list, get_volume_info -from cnslibs.common import exceptions -from cnslibs.common.baseclass import BaseClass -from cnslibs.common.heketi_ops import (heketi_node_list, - heketi_node_enable, - heketi_node_disable, - heketi_node_info, - heketi_device_enable, - heketi_device_disable, - heketi_volume_create, - heketi_volume_list, - heketi_volume_delete) -from cnslibs.common import podcmd +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs import exceptions +from openshiftstoragelibs.heketi_ops import ( + heketi_device_disable, + heketi_device_enable, + heketi_node_disable, + heketi_node_enable, + heketi_node_info, + heketi_node_list, + heketi_volume_create, + heketi_volume_delete, + heketi_volume_list, +) +from openshiftstoragelibs import podcmd class TestHeketiVolume(BaseClass): diff --git a/tests/functional/heketi/test_device_info.py b/tests/functional/heketi/test_device_info.py index a48fd814..96199f74 100644 --- a/tests/functional/heketi/test_device_info.py +++ b/tests/functional/heketi/test_device_info.py @@ -1,5 +1,5 @@ -from cnslibs.common.baseclass import BaseClass -from cnslibs.common import heketi_ops +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs import heketi_ops class TestHeketiDeviceInfo(BaseClass): diff --git a/tests/functional/heketi/test_disabling_device.py b/tests/functional/heketi/test_disabling_device.py index f0e2c5c6..c8ec026b 100644 --- a/tests/functional/heketi/test_disabling_device.py +++ b/tests/functional/heketi/test_disabling_device.py @@ -1,10 +1,10 @@ from glusto.core import Glusto as g from glustolibs.gluster.volume_ops import get_volume_info -from cnslibs.common import exceptions -from cnslibs.common import baseclass -from cnslibs.common import heketi_ops -from cnslibs.common import podcmd +from openshiftstoragelibs import baseclass +from openshiftstoragelibs import exceptions +from openshiftstoragelibs import heketi_ops +from openshiftstoragelibs import podcmd class TestDisableHeketiDevice(baseclass.BaseClass): diff --git a/tests/functional/heketi/test_heketi_create_volume.py b/tests/functional/heketi/test_heketi_create_volume.py index c1be0d86..e9679317 100644 --- a/tests/functional/heketi/test_heketi_create_volume.py +++ b/tests/functional/heketi/test_heketi_create_volume.py @@ -2,20 +2,22 @@ from glusto.core import Glusto as g from glustolibs.gluster.volume_ops import get_volume_list, get_volume_info import six -from cnslibs.common.exceptions import ExecutionError -from cnslibs.common.baseclass import BaseClass -from cnslibs.common.heketi_ops import (heketi_volume_create, - heketi_volume_list, - heketi_volume_info, - heketi_blockvolume_create, - heketi_blockvolume_delete, - heketi_cluster_list, - heketi_cluster_delete, - heketi_node_info, - heketi_node_list, - heketi_node_delete, - heketi_volume_delete) -from cnslibs.common import podcmd +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.exceptions import ExecutionError +from openshiftstoragelibs.heketi_ops import ( + heketi_blockvolume_create, + heketi_blockvolume_delete, + heketi_cluster_delete, + heketi_cluster_list, + heketi_node_delete, + heketi_node_info, + heketi_node_list, + heketi_volume_create, + heketi_volume_delete, + heketi_volume_info, + heketi_volume_list, +) +from openshiftstoragelibs import podcmd class TestHeketiVolume(BaseClass): diff --git a/tests/functional/heketi/test_heketi_device_operations.py b/tests/functional/heketi/test_heketi_device_operations.py index 8bd87089..bec1d01f 100644 --- a/tests/functional/heketi/test_heketi_device_operations.py +++ b/tests/functional/heketi/test_heketi_device_operations.py @@ -3,21 +3,23 @@ import json import ddt from glusto.core import Glusto as g -from cnslibs.common.exceptions import ExecutionError -from cnslibs.common.baseclass import BaseClass -from cnslibs.common.heketi_ops import (heketi_node_enable, - heketi_node_info, - heketi_node_disable, - heketi_node_list, - heketi_volume_create, - heketi_device_add, - heketi_device_delete, - heketi_device_disable, - heketi_device_remove, - heketi_device_info, - heketi_device_enable, - heketi_topology_info, - heketi_volume_delete) +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.exceptions import ExecutionError +from openshiftstoragelibs.heketi_ops import ( + heketi_device_add, + heketi_device_delete, + heketi_device_disable, + heketi_device_enable, + heketi_device_info, + heketi_device_remove, + heketi_node_disable, + heketi_node_enable, + heketi_node_info, + heketi_node_list, + heketi_topology_info, + heketi_volume_create, + heketi_volume_delete, +) @ddt.ddt diff --git a/tests/functional/heketi/test_heketi_metrics.py b/tests/functional/heketi/test_heketi_metrics.py index 4653caee..f6601074 100644 --- a/tests/functional/heketi/test_heketi_metrics.py +++ b/tests/functional/heketi/test_heketi_metrics.py @@ -1,20 +1,20 @@ -from cnslibs.common import exceptions -from cnslibs.common.baseclass import BaseClass -from cnslibs.common.heketi_ops import ( +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs import exceptions +from openshiftstoragelibs.heketi_ops import ( get_heketi_metrics, heketi_cluster_info, heketi_cluster_list, heketi_topology_info, heketi_volume_create, heketi_volume_delete, - heketi_volume_list - ) -from cnslibs.common import heketi_version -from cnslibs.common.openshift_ops import ( + heketi_volume_list, +) +from openshiftstoragelibs import heketi_version +from openshiftstoragelibs.openshift_ops import ( get_pod_name_from_dc, scale_dc_pod_amount_and_wait, - wait_for_pod_be_ready - ) + wait_for_pod_be_ready, +) class TestHeketiMetrics(BaseClass): diff --git a/tests/functional/heketi/test_heketi_volume_operations.py b/tests/functional/heketi/test_heketi_volume_operations.py index d7b9aa18..c5fc4f84 100644 --- a/tests/functional/heketi/test_heketi_volume_operations.py +++ b/tests/functional/heketi/test_heketi_volume_operations.py @@ -1,8 +1,10 @@ -from cnslibs.common.heketi_ops import (heketi_volume_delete, - heketi_volume_create, - heketi_volume_expand, - heketi_volume_info) -from cnslibs.common.baseclass import BaseClass +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.heketi_ops import ( + heketi_volume_create, + heketi_volume_delete, + heketi_volume_expand, + heketi_volume_info, +) class TestHeketiVolumeOperations(BaseClass): diff --git a/tests/functional/heketi/test_node_enable_disable.py b/tests/functional/heketi/test_node_enable_disable.py index b8ce2c71..dcd2f7b4 100644 --- a/tests/functional/heketi/test_node_enable_disable.py +++ b/tests/functional/heketi/test_node_enable_disable.py @@ -1,16 +1,18 @@ """Test cases to disable and enable node in heketi.""" import json -from cnslibs.common.baseclass import BaseClass -from cnslibs.common.heketi_ops import (heketi_node_enable, - heketi_node_info, - heketi_node_disable, - heketi_node_list, - heketi_volume_create, - heketi_volume_delete - ) from glusto.core import Glusto as g +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.heketi_ops import ( + heketi_node_disable, + heketi_node_enable, + heketi_node_info, + heketi_node_list, + heketi_volume_create, + heketi_volume_delete, +) + class TestHeketiNodeState(BaseClass): """Test node enable and disable functionality.""" diff --git a/tests/functional/heketi/test_node_info.py b/tests/functional/heketi/test_node_info.py index ad60b844..5bf7270f 100644 --- a/tests/functional/heketi/test_node_info.py +++ b/tests/functional/heketi/test_node_info.py @@ -2,8 +2,8 @@ from glusto.core import Glusto as g from glustolibs.gluster.exceptions import ExecutionError from glustolibs.gluster.peer_ops import get_pool_list -from cnslibs.common.baseclass import BaseClass -from cnslibs.common import heketi_ops, podcmd +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs import heketi_ops, podcmd class TestHeketiVolume(BaseClass): diff --git a/tests/functional/heketi/test_server_state_examine_gluster.py b/tests/functional/heketi/test_server_state_examine_gluster.py index f74366ed..22352024 100644 --- a/tests/functional/heketi/test_server_state_examine_gluster.py +++ b/tests/functional/heketi/test_server_state_examine_gluster.py @@ -1,7 +1,7 @@ -from cnslibs.common.baseclass import BaseClass -from cnslibs.common import heketi_ops -from cnslibs.common import heketi_version -from cnslibs.common import openshift_ops +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs import heketi_ops +from openshiftstoragelibs import heketi_version +from openshiftstoragelibs import openshift_ops class TestHeketiServerStateExamineGluster(BaseClass): diff --git a/tests/functional/heketi/test_volume_creation.py b/tests/functional/heketi/test_volume_creation.py index 86618505..f8ca5d81 100644 --- a/tests/functional/heketi/test_volume_creation.py +++ b/tests/functional/heketi/test_volume_creation.py @@ -1,10 +1,10 @@ from glusto.core import Glusto as g from glustolibs.gluster import volume_ops -from cnslibs.common import exceptions -from cnslibs.common.baseclass import BaseClass -from cnslibs.common import heketi_ops -from cnslibs.common import podcmd +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs import exceptions +from openshiftstoragelibs import heketi_ops +from openshiftstoragelibs import podcmd class TestVolumeCreationTestCases(BaseClass): diff --git a/tests/functional/heketi/test_volume_deletion.py b/tests/functional/heketi/test_volume_deletion.py index 6f279899..7b1f2ded 100644 --- a/tests/functional/heketi/test_volume_deletion.py +++ b/tests/functional/heketi/test_volume_deletion.py @@ -1,8 +1,8 @@ from __future__ import division -from cnslibs.common.exceptions import ExecutionError -from cnslibs.common.baseclass import BaseClass -from cnslibs.common import heketi_ops +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.exceptions import ExecutionError +from openshiftstoragelibs import heketi_ops class TestVolumeDeleteTestCases(BaseClass): diff --git a/tests/functional/heketi/test_volume_expansion_and_devices.py b/tests/functional/heketi/test_volume_expansion_and_devices.py index 5e189e49..d87c18e5 100644 --- a/tests/functional/heketi/test_volume_expansion_and_devices.py +++ b/tests/functional/heketi/test_volume_expansion_and_devices.py @@ -4,9 +4,12 @@ import math from glusto.core import Glusto as g from glustolibs.gluster import volume_ops, rebalance_ops -from cnslibs.common.exceptions import ExecutionError -from cnslibs.common.baseclass import BaseClass -from cnslibs.common import heketi_ops, podcmd +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.exceptions import ExecutionError +from openshiftstoragelibs import ( + heketi_ops, + podcmd, +) class TestVolumeExpansionAndDevicesTestCases(BaseClass): diff --git a/tests/functional/heketi/test_volume_multi_req.py b/tests/functional/heketi/test_volume_multi_req.py index f6b0fcf6..3445a8a4 100644 --- a/tests/functional/heketi/test_volume_multi_req.py +++ b/tests/functional/heketi/test_volume_multi_req.py @@ -11,14 +11,20 @@ import yaml from glusto.core import Glusto as g -from cnslibs.common.baseclass import BaseClass -from cnslibs.common.heketi_ops import ( - heketi_volume_list) -from cnslibs.common.naming import ( - make_unique_label, extract_method_name) -from cnslibs.common.openshift_ops import ( - oc_create, oc_delete, oc_get_pvc, oc_get_pv, oc_get_all_pvs) -from cnslibs.common.waiter import Waiter +from openshiftstoragelibs.baseclass import BaseClass +from openshiftstoragelibs.heketi_ops import heketi_volume_list +from openshiftstoragelibs.naming import ( + make_unique_label, + extract_method_name, +) +from openshiftstoragelibs.openshift_ops import ( + oc_create, + oc_delete, + oc_get_all_pvs, + oc_get_pv, + oc_get_pvc, +) +from openshiftstoragelibs.waiter import Waiter def build_storage_class(name, resturl, restuser='foo', restuserkey='foo'): -- cgit