From c5af421a80e404d93cba91b98fff199a27f6436f Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 9 Sep 2020 14:30:12 +0100 Subject: [PATCH] Rename 'internal' dir to 'synapse' We needed to switch the admin import as else it tries to import relatively, and we end up importing the wrong module. --- synapse/app/homeserver.py | 2 +- synapse/rest/__init__.py | 6 ++---- synapse/rest/{internal => synapse}/__init__.py | 0 synapse/rest/{internal => synapse}/client/__init__.py | 0 synapse/rest/{internal => synapse}/client/password_reset.py | 0 tests/rest/client/v2_alpha/test_account.py | 2 +- 6 files changed, 4 insertions(+), 6 deletions(-) rename synapse/rest/{internal => synapse}/__init__.py (100%) rename synapse/rest/{internal => synapse}/client/__init__.py (100%) rename synapse/rest/{internal => synapse}/client/password_reset.py (100%) diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index af5963764678..b08319ca77f6 100644 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -211,7 +211,7 @@ def _configure_named_resource(self, name, compress=False): resources["/_matrix/saml2"] = SAML2Resource(self) if self.get_config().threepid_behaviour_email == ThreepidBehaviour.LOCAL: - from synapse.rest.internal.client.password_reset import ( + from synapse.rest.synapse.client.password_reset import ( PasswordResetSubmitTokenResource, ) diff --git a/synapse/rest/__init__.py b/synapse/rest/__init__.py index 87f927890c5e..40f5c32db2df 100644 --- a/synapse/rest/__init__.py +++ b/synapse/rest/__init__.py @@ -13,8 +13,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import synapse.rest.admin from synapse.http.server import JsonResource +from synapse.rest import admin from synapse.rest.client import versions from synapse.rest.client.v1 import ( directory, @@ -123,9 +123,7 @@ def register_servlets(client_resource, hs): password_policy.register_servlets(hs, client_resource) # moving to /_synapse/admin - synapse.rest.admin.register_servlets_for_client_rest_resource( - hs, client_resource - ) + admin.register_servlets_for_client_rest_resource(hs, client_resource) # unstable shared_rooms.register_servlets(hs, client_resource) diff --git a/synapse/rest/internal/__init__.py b/synapse/rest/synapse/__init__.py similarity index 100% rename from synapse/rest/internal/__init__.py rename to synapse/rest/synapse/__init__.py diff --git a/synapse/rest/internal/client/__init__.py b/synapse/rest/synapse/client/__init__.py similarity index 100% rename from synapse/rest/internal/client/__init__.py rename to synapse/rest/synapse/client/__init__.py diff --git a/synapse/rest/internal/client/password_reset.py b/synapse/rest/synapse/client/password_reset.py similarity index 100% rename from synapse/rest/internal/client/password_reset.py rename to synapse/rest/synapse/client/password_reset.py diff --git a/tests/rest/client/v2_alpha/test_account.py b/tests/rest/client/v2_alpha/test_account.py index c31db7f983fa..93f899d86133 100644 --- a/tests/rest/client/v2_alpha/test_account.py +++ b/tests/rest/client/v2_alpha/test_account.py @@ -28,7 +28,7 @@ from synapse.api.errors import Codes from synapse.rest.client.v1 import login, room from synapse.rest.client.v2_alpha import account, register -from synapse.rest.internal.client.password_reset import PasswordResetSubmitTokenResource +from synapse.rest.synapse.client.password_reset import PasswordResetSubmitTokenResource from tests import unittest from tests.unittest import override_config