diff --git a/awx/api/generics.py b/awx/api/generics.py index 7b8a098e83..44d39c6e43 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -248,7 +248,7 @@ class APIView(views.APIView): response['X-API-Query-Time'] = '%0.3fs' % sum(q_times) if getattr(self, 'deprecated', False): - response['Warning'] = '299 awx "This resource has been deprecated and will be removed in a future release."' # noqa + response['Warning'] = '299 awx "This resource has been deprecated and will be removed in a future release."' return response diff --git a/awx/api/urls/instance.py b/awx/api/urls/instance.py index 8dad087b82..0d4df1df45 100644 --- a/awx/api/urls/instance.py +++ b/awx/api/urls/instance.py @@ -9,9 +9,9 @@ from awx.api.views import ( InstanceUnifiedJobsList, InstanceInstanceGroupsList, InstanceHealthCheck, - InstanceInstallBundle, InstancePeersList, ) +from awx.api.views.instance_install_bundle import InstanceInstallBundle urls = [ diff --git a/awx/api/urls/inventory.py b/awx/api/urls/inventory.py index 863591ba60..7e2fa4ebe2 100644 --- a/awx/api/urls/inventory.py +++ b/awx/api/urls/inventory.py @@ -3,26 +3,28 @@ from django.urls import re_path -from awx.api.views import ( +from awx.api.views.inventory import ( InventoryList, InventoryDetail, - InventoryHostsList, - InventoryGroupsList, - InventoryRootGroupsList, - InventoryVariableData, - InventoryScriptView, - InventoryTreeView, - InventoryInventorySourcesList, - InventoryInventorySourcesUpdate, InventoryActivityStreamList, InventoryJobTemplateList, - InventoryAdHocCommandsList, InventoryAccessList, InventoryObjectRolesList, InventoryInstanceGroupsList, InventoryLabelList, InventoryCopy, ) +from awx.api.views import ( + InventoryHostsList, + InventoryGroupsList, + InventoryInventorySourcesList, + InventoryInventorySourcesUpdate, + InventoryAdHocCommandsList, + InventoryRootGroupsList, + InventoryScriptView, + InventoryTreeView, + InventoryVariableData, +) urls = [ diff --git a/awx/api/urls/inventory_update.py b/awx/api/urls/inventory_update.py index 6855561a72..69b94e23c7 100644 --- a/awx/api/urls/inventory_update.py +++ b/awx/api/urls/inventory_update.py @@ -3,6 +3,9 @@ from django.urls import re_path +from awx.api.views.inventory import ( + InventoryUpdateEventsList, +) from awx.api.views import ( InventoryUpdateList, InventoryUpdateDetail, @@ -10,7 +13,6 @@ from awx.api.views import ( InventoryUpdateStdout, InventoryUpdateNotificationsList, InventoryUpdateCredentialsList, - InventoryUpdateEventsList, ) diff --git a/awx/api/urls/oauth2_root.py b/awx/api/urls/oauth2_root.py index d15d14825e..1a5a444bc6 100644 --- a/awx/api/urls/oauth2_root.py +++ b/awx/api/urls/oauth2_root.py @@ -10,7 +10,7 @@ from oauthlib import oauth2 from oauth2_provider import views from awx.main.models import RefreshToken -from awx.api.views import ApiOAuthAuthorizationRootView +from awx.api.views.root import ApiOAuthAuthorizationRootView class TokenView(views.TokenView): diff --git a/awx/api/urls/organization.py b/awx/api/urls/organization.py index c841a53181..a75ee9d3cc 100644 --- a/awx/api/urls/organization.py +++ b/awx/api/urls/organization.py @@ -3,7 +3,7 @@ from django.urls import re_path -from awx.api.views import ( +from awx.api.views.organization import ( OrganizationList, OrganizationDetail, OrganizationUsersList, @@ -14,7 +14,6 @@ from awx.api.views import ( OrganizationJobTemplatesList, OrganizationWorkflowJobTemplatesList, OrganizationTeamsList, - OrganizationCredentialList, OrganizationActivityStreamList, OrganizationNotificationTemplatesList, OrganizationNotificationTemplatesErrorList, @@ -25,8 +24,8 @@ from awx.api.views import ( OrganizationGalaxyCredentialsList, OrganizationObjectRolesList, OrganizationAccessList, - OrganizationApplicationList, ) +from awx.api.views import OrganizationCredentialList, OrganizationApplicationList urls = [ diff --git a/awx/api/urls/urls.py b/awx/api/urls/urls.py index 2122369919..5d0818b191 100644 --- a/awx/api/urls/urls.py +++ b/awx/api/urls/urls.py @@ -6,13 +6,15 @@ from django.urls import include, re_path from awx import MODE from awx.api.generics import LoggedLoginView, LoggedLogoutView -from awx.api.views import ( +from awx.api.views.root import ( ApiRootView, ApiV2RootView, ApiV2PingView, ApiV2ConfigView, ApiV2SubscriptionView, ApiV2AttachView, +) +from awx.api.views import ( AuthView, UserMeList, DashboardView, @@ -28,8 +30,8 @@ from awx.api.views import ( OAuth2TokenList, ApplicationOAuth2TokenList, OAuth2ApplicationDetail, - MeshVisualizer, ) +from awx.api.views.mesh_visualizer import MeshVisualizer from awx.api.views.metrics import MetricsView diff --git a/awx/api/urls/webhooks.py b/awx/api/urls/webhooks.py index 764e3dd6e2..b57ca135d8 100644 --- a/awx/api/urls/webhooks.py +++ b/awx/api/urls/webhooks.py @@ -1,6 +1,6 @@ from django.urls import re_path -from awx.api.views import WebhookKeyView, GithubWebhookReceiver, GitlabWebhookReceiver +from awx.api.views.webhooks import WebhookKeyView, GithubWebhookReceiver, GitlabWebhookReceiver urlpatterns = [ diff --git a/awx/api/views/__init__.py b/awx/api/views/__init__.py index 072f0b447f..95392b3044 100644 --- a/awx/api/views/__init__.py +++ b/awx/api/views/__init__.py @@ -122,56 +122,6 @@ from awx.api.views.mixin import ( UnifiedJobDeletionMixin, NoTruncateMixin, ) -from awx.api.views.instance_install_bundle import InstanceInstallBundle # noqa -from awx.api.views.inventory import ( # noqa - InventoryList, - InventoryDetail, - InventoryUpdateEventsList, - InventoryList, - InventoryDetail, - InventoryActivityStreamList, - InventoryInstanceGroupsList, - InventoryAccessList, - InventoryObjectRolesList, - InventoryJobTemplateList, - InventoryLabelList, - InventoryCopy, -) -from awx.api.views.mesh_visualizer import MeshVisualizer # noqa -from awx.api.views.organization import ( # noqa - OrganizationList, - OrganizationDetail, - OrganizationInventoriesList, - OrganizationUsersList, - OrganizationAdminsList, - OrganizationExecutionEnvironmentsList, - OrganizationProjectsList, - OrganizationJobTemplatesList, - OrganizationWorkflowJobTemplatesList, - OrganizationTeamsList, - OrganizationActivityStreamList, - OrganizationNotificationTemplatesList, - OrganizationNotificationTemplatesAnyList, - OrganizationNotificationTemplatesErrorList, - OrganizationNotificationTemplatesStartedList, - OrganizationNotificationTemplatesSuccessList, - OrganizationNotificationTemplatesApprovalList, - OrganizationInstanceGroupsList, - OrganizationGalaxyCredentialsList, - OrganizationAccessList, - OrganizationObjectRolesList, -) -from awx.api.views.root import ( # noqa - ApiRootView, - ApiOAuthAuthorizationRootView, - ApiVersionRootView, - ApiV2RootView, - ApiV2PingView, - ApiV2ConfigView, - ApiV2SubscriptionView, - ApiV2AttachView, -) -from awx.api.views.webhooks import WebhookKeyView, GithubWebhookReceiver, GitlabWebhookReceiver # noqa from awx.api.pagination import UnifiedJobEventPagination from awx.main.utils import set_environ diff --git a/awx/main/tests/unit/api/test_views.py b/awx/main/tests/unit/api/test_views.py index e2a482e1dc..1f17a487cb 100644 --- a/awx/main/tests/unit/api/test_views.py +++ b/awx/main/tests/unit/api/test_views.py @@ -5,7 +5,8 @@ from unittest import mock from collections import namedtuple -from awx.api.views import ApiVersionRootView, JobTemplateLabelList, InventoryInventorySourcesUpdate, JobTemplateSurveySpec +from awx.api.views.root import ApiVersionRootView +from awx.api.views import JobTemplateLabelList, InventoryInventorySourcesUpdate, JobTemplateSurveySpec from awx.main.views import handle_error