From e7c6f53d28c15c167ea8cfd278a0e0605db6e8da Mon Sep 17 00:00:00 2001 From: matancarmeli7 Date: Sun, 5 Feb 2023 10:24:58 +0200 Subject: [PATCH] organize directories Signed-off-by: matancarmeli7 --- controllers/servers/csi/controller_server/__init__.py | 0 .../{ => controller_server}/controller_server_manager.py | 4 ++-- .../csi/{ => controller_server}/csi_controller_server.py | 0 .../csi/{ => controller_server}/volume_group_server.py | 0 controllers/servers/csi/main.py | 2 +- .../tests/controller_server/controller_server/__init__.py | 0 .../{ => controller_server}/csi_controller_server_test.py | 6 +++--- .../{ => controller_server}/volume_group_server_test.py | 6 +++--- controllers/tests/controller_server/csi_addons/__init__.py | 0 .../{ => csi_addons}/addons_server_test.py | 2 +- controllers/tests/controller_server/utils_test.py | 4 ++-- 11 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 controllers/servers/csi/controller_server/__init__.py rename controllers/servers/csi/{ => controller_server}/controller_server_manager.py (90%) rename controllers/servers/csi/{ => controller_server}/csi_controller_server.py (100%) rename controllers/servers/csi/{ => controller_server}/volume_group_server.py (100%) create mode 100644 controllers/tests/controller_server/controller_server/__init__.py rename controllers/tests/controller_server/{ => controller_server}/csi_controller_server_test.py (97%) rename controllers/tests/controller_server/{ => controller_server}/volume_group_server_test.py (97%) create mode 100644 controllers/tests/controller_server/csi_addons/__init__.py rename controllers/tests/controller_server/{ => csi_addons}/addons_server_test.py (99%) diff --git a/controllers/servers/csi/controller_server/__init__.py b/controllers/servers/csi/controller_server/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/controllers/servers/csi/controller_server_manager.py b/controllers/servers/csi/controller_server/controller_server_manager.py similarity index 90% rename from controllers/servers/csi/controller_server_manager.py rename to controllers/servers/csi/controller_server/controller_server_manager.py index 2dd9d341f..c69e5d377 100644 --- a/controllers/servers/csi/controller_server_manager.py +++ b/controllers/servers/csi/controller_server/controller_server_manager.py @@ -8,8 +8,8 @@ from controllers.common.config import config from controllers.common.csi_logger import get_stdout_logger from controllers.common.settings import CSI_CONTROLLER_SERVER_WORKERS -from controllers.servers.csi.csi_controller_server import CSIControllerServicer -from controllers.servers.csi.volume_group_server import VolumeGroupControllerServicer +from controllers.servers.csi.controller_server.csi_controller_server import CSIControllerServicer +from controllers.servers.csi.controller_server.volume_group_server import VolumeGroupControllerServicer logger = get_stdout_logger() diff --git a/controllers/servers/csi/csi_controller_server.py b/controllers/servers/csi/controller_server/csi_controller_server.py similarity index 100% rename from controllers/servers/csi/csi_controller_server.py rename to controllers/servers/csi/controller_server/csi_controller_server.py diff --git a/controllers/servers/csi/volume_group_server.py b/controllers/servers/csi/controller_server/volume_group_server.py similarity index 100% rename from controllers/servers/csi/volume_group_server.py rename to controllers/servers/csi/controller_server/volume_group_server.py diff --git a/controllers/servers/csi/main.py b/controllers/servers/csi/main.py index e82dfd18f..87fb4ece7 100644 --- a/controllers/servers/csi/main.py +++ b/controllers/servers/csi/main.py @@ -2,7 +2,7 @@ from threading import Thread from controllers.common.csi_logger import set_log_level -from controllers.servers.csi.controller_server_manager import ControllerServerManager +from controllers.servers.csi.controller_server.controller_server_manager import ControllerServerManager from controllers.servers.csi.csi_addons_server.csi_addons_server_manager import CSIAddonsServerManager diff --git a/controllers/tests/controller_server/controller_server/__init__.py b/controllers/tests/controller_server/controller_server/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/controllers/tests/controller_server/csi_controller_server_test.py b/controllers/tests/controller_server/controller_server/csi_controller_server_test.py similarity index 97% rename from controllers/tests/controller_server/csi_controller_server_test.py rename to controllers/tests/controller_server/controller_server/csi_controller_server_test.py index 51ae5ac62..e40e7e11a 100644 --- a/controllers/tests/controller_server/csi_controller_server_test.py +++ b/controllers/tests/controller_server/controller_server/csi_controller_server_test.py @@ -11,7 +11,7 @@ import controllers.servers.settings as servers_settings from controllers.array_action.array_action_types import ObjectIds from controllers.array_action.array_mediator_xiv import XIVArrayMediator -from controllers.servers.csi.csi_controller_server import CSIControllerServicer +from controllers.servers.csi.controller_server.csi_controller_server import CSIControllerServicer from controllers.servers.csi.sync_lock import SyncLock from controllers.tests import utils from controllers.tests.common.test_settings import (CLONE_VOLUME_NAME, @@ -30,7 +30,7 @@ from controllers.tests.controller_server.common import mock_get_agent, mock_array_type, mock_mediator from controllers.tests.utils import ProtoBufMock -CONTROLLER_SERVER_PATH = "controllers.servers.csi.csi_controller_server" +CONTROLLER_SERVER_PATH = "controllers.servers.csi.controller_server.csi_controller_server" class BaseControllerSetUp(unittest.TestCase): @@ -911,7 +911,7 @@ def test_delete_volume_invalid_volume_id(self): self.assertEqual(self.context.code, grpc.StatusCode.OK) - @patch("controllers.servers.csi.csi_controller_server.get_agent") + @patch("controllers.servers.csi.controller_server.csi_controller_server.get_agent") def test_delete_volume_with_array_connection_exception(self, storage_agent): storage_agent.side_effect = [Exception("a_enter error")] diff --git a/controllers/tests/controller_server/volume_group_server_test.py b/controllers/tests/controller_server/controller_server/volume_group_server_test.py similarity index 97% rename from controllers/tests/controller_server/volume_group_server_test.py rename to controllers/tests/controller_server/controller_server/volume_group_server_test.py index 86901b761..16351425e 100644 --- a/controllers/tests/controller_server/volume_group_server_test.py +++ b/controllers/tests/controller_server/controller_server/volume_group_server_test.py @@ -7,15 +7,15 @@ from controllers.array_action import errors as array_errors from controllers.servers import settings as servers_settings -from controllers.servers.csi.volume_group_server import VolumeGroupControllerServicer +from controllers.servers.csi.controller_server.volume_group_server import VolumeGroupControllerServicer from controllers.tests import utils from controllers.tests.common.test_settings import SECRET, VOLUME_GROUP_NAME, NAME_PREFIX, REQUEST_VOLUME_GROUP_ID, \ VOLUME_GROUP_UID, REQUEST_VOLUME_ID, VOLUME_UID, REQUEST_REAL_VOLUME_ID, REAL_NGUID from controllers.tests.controller_server.common import mock_array_type, mock_mediator, mock_get_agent -from controllers.tests.controller_server.csi_controller_server_test import CommonControllerTest +from controllers.tests.controller_server.controller_server.csi_controller_server_test import CommonControllerTest from controllers.tests.utils import ProtoBufMock -VG_CONTROLLER_SERVER_PATH = "controllers.servers.csi.volume_group_server" +VG_CONTROLLER_SERVER_PATH = "controllers.servers.csi.controller_server.volume_group_server" class BaseVgControllerSetUp(unittest.TestCase): diff --git a/controllers/tests/controller_server/csi_addons/__init__.py b/controllers/tests/controller_server/csi_addons/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/controllers/tests/controller_server/addons_server_test.py b/controllers/tests/controller_server/csi_addons/addons_server_test.py similarity index 99% rename from controllers/tests/controller_server/addons_server_test.py rename to controllers/tests/controller_server/csi_addons/addons_server_test.py index b980cb0ee..08b98d49e 100644 --- a/controllers/tests/controller_server/addons_server_test.py +++ b/controllers/tests/controller_server/csi_addons/addons_server_test.py @@ -13,7 +13,7 @@ OTHER_OBJECT_INTERNAL_ID, REPLICATION_NAME, SYSTEM_ID, COPY_TYPE, SECRET_USERNAME_VALUE, SECRET_PASSWORD_VALUE, \ SECRET_MANAGEMENT_ADDRESS_VALUE, DUMMY_VOLUME_GROUP from controllers.tests.controller_server.common import mock_get_agent -from controllers.tests.controller_server.csi_controller_server_test import (CommonControllerTest) +from controllers.tests.controller_server.controller_server.csi_controller_server_test import (CommonControllerTest) from controllers.tests.utils import ProtoBufMock ADDON_SERVER_PATH = "controllers.servers.csi.csi_addons_server.replication_controller_servicer" diff --git a/controllers/tests/controller_server/utils_test.py b/controllers/tests/controller_server/utils_test.py index 04382d48e..f3734a9f9 100644 --- a/controllers/tests/controller_server/utils_test.py +++ b/controllers/tests/controller_server/utils_test.py @@ -14,11 +14,11 @@ from controllers.common.settings import SPACE_EFFICIENCY_DEDUPLICATED_COMPRESSED, SPACE_EFFICIENCY_NONE, \ SPACE_EFFICIENCY_DEDUPLICATED, SPACE_EFFICIENCY_THIN from controllers.servers import settings as controller_config -from controllers.servers.csi.csi_controller_server import CSIControllerServicer +from controllers.servers.csi.controller_server.csi_controller_server import CSIControllerServicer from controllers.servers.errors import ObjectIdError, ValidationException, InvalidNodeId from controllers.tests import utils as test_utils from controllers.tests.common.test_settings import DUMMY_POOL1, SECRET_USERNAME_VALUE, SECRET_PASSWORD_VALUE, ARRAY -from controllers.tests.controller_server.csi_controller_server_test import ProtoBufMock +from controllers.tests.controller_server.controller_server.csi_controller_server_test import ProtoBufMock from controllers.tests.utils import get_fake_secret_config