W504 Move binary operator to start of line from end of line

PEP8 prefers binary operators at the start of a line
https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
This commit is contained in:
Will Thames
2020-06-09 18:54:48 +10:00
parent 59348066a0
commit 43ae9664fc

View File

@@ -325,21 +325,21 @@ class KubernetesAnsibleModule(AnsibleModule, K8sAnsibleMixin):
# Scaling up means that we also need to check that we're not in a # Scaling up means that we also need to check that we're not in a
# situation where status.replicas == status.availableReplicas # situation where status.replicas == status.availableReplicas
# but spec.replicas != status.replicas # but spec.replicas != status.replicas
return (deployment.status and return (deployment.status
deployment.spec.replicas == (deployment.status.replicas or 0) and and deployment.spec.replicas == (deployment.status.replicas or 0)
deployment.status.availableReplicas == deployment.status.replicas and and deployment.status.availableReplicas == deployment.status.replicas
deployment.status.observedGeneration == deployment.metadata.generation and and deployment.status.observedGeneration == deployment.metadata.generation
not deployment.status.unavailableReplicas) and not deployment.status.unavailableReplicas)
def _pod_ready(pod): def _pod_ready(pod):
return (pod.status and pod.status.containerStatuses is not None and return (pod.status and pod.status.containerStatuses is not None
all([container.ready for container in pod.status.containerStatuses])) and all([container.ready for container in pod.status.containerStatuses]))
def _daemonset_ready(daemonset): def _daemonset_ready(daemonset):
return (daemonset.status and daemonset.status.desiredNumberScheduled is not None and return (daemonset.status and daemonset.status.desiredNumberScheduled is not None
daemonset.status.numberReady == daemonset.status.desiredNumberScheduled and and daemonset.status.numberReady == daemonset.status.desiredNumberScheduled
daemonset.status.observedGeneration == daemonset.metadata.generation and and daemonset.status.observedGeneration == daemonset.metadata.generation
not daemonset.status.unavailableReplicas) and not daemonset.status.unavailableReplicas)
def _custom_condition(resource): def _custom_condition(resource):
if not resource.status or not resource.status.conditions: if not resource.status or not resource.status.conditions: