diff --git a/awx/api/generics.py b/awx/api/generics.py index c6be2ac740a5..20476bbb06c0 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -789,7 +789,7 @@ def partial_update(self, request, *args, **kwargs): return super(RetrieveUpdateAPIView, self).partial_update(request, *args, **kwargs) def update_filter(self, request, *args, **kwargs): - ''' scrub any fields the user cannot/should not put/patch, based on user context. This runs after read-only serialization filtering ''' + '''scrub any fields the user cannot/should not put/patch, based on user context. This runs after read-only serialization filtering''' pass diff --git a/awx/api/views/__init__.py b/awx/api/views/__init__.py index 789abe11e69c..f50eee3ace73 100644 --- a/awx/api/views/__init__.py +++ b/awx/api/views/__init__.py @@ -207,7 +207,7 @@ class DashboardView(APIView): swagger_topic = 'Dashboard' def get(self, request, format=None): - ''' Show Dashboard Details ''' + '''Show Dashboard Details''' data = OrderedDict() data['related'] = {'jobs_graph': reverse('api:dashboard_jobs_graph_view', request=request)} user_inventory = get_user_queryset(request.user, models.Inventory) @@ -542,7 +542,7 @@ class ScheduleUnifiedJobsList(SubListAPIView): class AuthView(APIView): - ''' List enabled single-sign-on endpoints ''' + '''List enabled single-sign-on endpoints''' authentication_classes = [] permission_classes = (AllowAny,) @@ -1233,7 +1233,7 @@ class UserDetail(RetrieveUpdateDestroyAPIView): serializer_class = serializers.UserSerializer def update_filter(self, request, *args, **kwargs): - ''' make sure non-read-only fields that can only be edited by admins, are only edited by admins ''' + '''make sure non-read-only fields that can only be edited by admins, are only edited by admins''' obj = self.get_object() can_change = request.user.can_access(models.User, 'change', obj, request.data) can_admin = request.user.can_access(models.User, 'admin', obj, request.data) @@ -1596,7 +1596,7 @@ def get_queryset(self): class HostGroupsList(ControlledByScmMixin, SubListCreateAttachDetachAPIView): - ''' the list of groups a host is directly a member of ''' + '''the list of groups a host is directly a member of''' model = models.Group serializer_class = serializers.GroupSerializer @@ -1618,7 +1618,7 @@ def create(self, request, *args, **kwargs): class HostAllGroupsList(SubListAPIView): - ''' the list of all groups of which the host is directly or indirectly a member ''' + '''the list of all groups of which the host is directly or indirectly a member''' model = models.Group serializer_class = serializers.GroupSerializer @@ -1858,7 +1858,7 @@ def get_queryset(self): class GroupHostsList(HostRelatedSearchMixin, ControlledByScmMixin, SubListCreateAttachDetachAPIView): - ''' the list of hosts directly below a group ''' + '''the list of hosts directly below a group''' model = models.Host serializer_class = serializers.HostSerializer @@ -1883,7 +1883,7 @@ def create(self, request, *args, **kwargs): class GroupAllHostsList(HostRelatedSearchMixin, SubListAPIView): - ''' the list of all hosts below a group, even including subgroups ''' + '''the list of all hosts below a group, even including subgroups''' model = models.Host serializer_class = serializers.HostSerializer diff --git a/awx/api/views/metrics.py b/awx/api/views/metrics.py index 212acf389057..5a37092dd42f 100644 --- a/awx/api/views/metrics.py +++ b/awx/api/views/metrics.py @@ -32,7 +32,7 @@ class MetricsView(APIView): renderer_classes = [renderers.PlainTextRenderer, renderers.PrometheusJSONRenderer, renderers.BrowsableAPIRenderer] def get(self, request): - ''' Show Metrics Details ''' + '''Show Metrics Details''' if request.user.is_superuser or request.user.is_system_auditor: metrics_to_show = '' if not request.query_params.get('subsystemonly', "0") == "1": diff --git a/awx/api/views/root.py b/awx/api/views/root.py index fdbf56580f8b..e27715af9263 100644 --- a/awx/api/views/root.py +++ b/awx/api/views/root.py @@ -43,7 +43,7 @@ class ApiRootView(APIView): @method_decorator(ensure_csrf_cookie) def get(self, request, format=None): - ''' List supported API versions ''' + '''List supported API versions''' v2 = reverse('api:api_v2_root_view', kwargs={'version': 'v2'}) data = OrderedDict() @@ -78,7 +78,7 @@ class ApiVersionRootView(APIView): swagger_topic = 'Versioning' def get(self, request, format=None): - ''' List top level resources ''' + '''List top level resources''' data = OrderedDict() data['ping'] = reverse('api:api_v2_ping_view', request=request) data['instances'] = reverse('api:instance_list', request=request) diff --git a/awx/conf/serializers.py b/awx/conf/serializers.py index 838a636aaa66..f3f521e849fb 100644 --- a/awx/conf/serializers.py +++ b/awx/conf/serializers.py @@ -28,7 +28,7 @@ def __init__(self, instance=None, data=serializers.empty, **kwargs): class SettingCategorySerializer(serializers.Serializer): - """Serialize setting category """ + """Serialize setting category""" url = serializers.CharField(read_only=True) slug = serializers.CharField(read_only=True) diff --git a/awx/main/models/base.py b/awx/main/models/base.py index e39891f54628..8cdd557a84a6 100644 --- a/awx/main/models/base.py +++ b/awx/main/models/base.py @@ -354,7 +354,7 @@ def validate_unique(self, exclude=None): class CommonModel(PrimordialModel): - ''' a base model where the name is unique ''' + '''a base model where the name is unique''' class Meta: abstract = True @@ -366,7 +366,7 @@ class Meta: class CommonModelNameNotUnique(PrimordialModel): - ''' a base model where the name is not unique ''' + '''a base model where the name is not unique''' class Meta: abstract = True diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 6bc85e316232..bb4c780c2ad5 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -1224,7 +1224,7 @@ def task_impact(self): raise NotImplementedError # Implement in subclass. def websocket_emit_data(self): - ''' Return extra data that should be included when submitting data to the browser over the websocket connection ''' + '''Return extra data that should be included when submitting data to the browser over the websocket connection''' websocket_data = dict(type=self.job_type_name) if self.spawned_by_workflow: websocket_data.update(dict(workflow_job_id=self.workflow_job_id, workflow_node_id=self.workflow_node_id)) diff --git a/awx/main/scheduler/dag_simple.py b/awx/main/scheduler/dag_simple.py index ec21b0a0e05f..917d51eed316 100644 --- a/awx/main/scheduler/dag_simple.py +++ b/awx/main/scheduler/dag_simple.py @@ -2,7 +2,7 @@ class SimpleDAG(object): - ''' A simple implementation of a directed acyclic graph ''' + '''A simple implementation of a directed acyclic graph''' def __init__(self): self.nodes = [] diff --git a/awx/main/tests/functional/api/test_generic.py b/awx/main/tests/functional/api/test_generic.py index 608a15c2f843..0c064f23a40c 100644 --- a/awx/main/tests/functional/api/test_generic.py +++ b/awx/main/tests/functional/api/test_generic.py @@ -79,7 +79,7 @@ def test_filterable_fields(options, instance, admin_user): @pytest.mark.django_db def test_handle_content_type(post, admin): - ''' Tower should return 415 when wrong content type is in HTTP requests ''' + '''Tower should return 415 when wrong content type is in HTTP requests''' post(reverse('api:project_list'), {'name': 't', 'organization': None}, admin, content_type='text/html', expect=415) diff --git a/awx/main/tests/unit/api/test_views.py b/awx/main/tests/unit/api/test_views.py index 2be393c4602a..8e7b7a73dc43 100644 --- a/awx/main/tests/unit/api/test_views.py +++ b/awx/main/tests/unit/api/test_views.py @@ -311,7 +311,7 @@ def test_survey_spec_element_missing_property(self): @pytest.mark.parametrize('_type', ['integer', 'float']) def test_survey_spec_element_number_empty_default(self, _type): - """ Assert that empty default is allowed for answer. """ + """Assert that empty default is allowed for answer.""" spec = self.spec_from_element({'type': _type, 'default': ''}) r = JobTemplateSurveySpec._validate_spec_data(spec, {}) assert r is None