pre-commit: enable Python flake8 rule E272 (#9361)

There should be only one space before a keyword.
This commit is contained in:
John Bampton 2024-07-10 17:17:25 +10:00 committed by GitHub
parent c6d3f6e623
commit 806692bcea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 20 additions and 19 deletions

View File

@ -23,6 +23,7 @@
# E227 Missing whitespace around bitwise or shift operator
# E242 Tab after ','
# E271 Multiple spaces after keyword
# E272 Multiple spaces before keyword
# E273 Tab after keyword
# E274 Tab before keyword
# E713 Test for membership should be 'not in'
@ -39,4 +40,4 @@
exclude =
.git,
venv
select = E112,E113,E133,E223,E224,E227,E242,E271,E273,E274,E713,E742,E743,E901,E902,W291,W292,W293,W391
select = E112,E113,E133,E223,E224,E227,E242,E271,E272,E273,E274,E713,E742,E743,E901,E902,W291,W292,W293,W391

View File

@ -58,7 +58,7 @@ class ConfigFileOps:
def save(self):
fp = open(self.fileName, "r")
newLines = []
for line in fp.readlines():
for line in fp.readlines():
matched = False
for entry in self.entries:
if entry.op == "add":

View File

@ -63,7 +63,7 @@ class configFileOps:
newLines = []
if os.path.exists(self.fileName) and os.path.isfile(self.fileName):
fp = open(self.fileName, "r")
for line in fp.readlines():
for line in fp.readlines():
matched = False
for entry in self.entries:
if entry.op == "add":

View File

@ -938,7 +938,7 @@ def cleanup_rules():
vmpresent = False
for vm in vmsInHost:
if vm_name in vm:
if vm_name in vm:
vmpresent = True
break
@ -958,7 +958,7 @@ def cleanup_rules():
vm_name = chain
vmpresent = False
for vm in vmsInHost:
if vm_name in vm:
if vm_name in vm:
vmpresent = True
break

View File

@ -33,8 +33,8 @@ import syslog
import threading
import urllib.parse
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn #, ForkingMixIn
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn #, ForkingMixIn
passMap = {}

View File

@ -18,9 +18,9 @@
"""
"""
#Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.base import (Account,
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.base import (Account,
Domain,
User,
Project,

View File

@ -18,10 +18,10 @@
"""
"""
#Import Local Modules
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
from nose.plugins.attrib import attr
from marvin.cloudstackTestCase import cloudstackTestCase
import unittest
from marvin.lib.base import (Account,
from marvin.lib.base import (Account,
Domain,
Router,
Network,

View File

@ -2073,7 +2073,7 @@ class TestStoragePool(cloudstackTestCase):
clusterid = c.id
)
for conf in configuration:
if conf.name == 'sp.cluster.id' and (conf.value in clusterid[1]):
if conf.name == 'sp.cluster.id' and (conf.value in clusterid[1]):
return c
@classmethod
@ -2088,7 +2088,7 @@ class TestStoragePool(cloudstackTestCase):
clusterid = c.id
)
for conf in configuration:
if conf.name == 'sp.cluster.id' and (conf.value not in clusterid[1]):
if conf.name == 'sp.cluster.id' and (conf.value not in clusterid[1]):
return c
@classmethod

View File

@ -384,7 +384,7 @@ class StorPoolHelper():
clusterid = c.id
)
for conf in configuration:
if conf.name == 'sp.cluster.id' and (conf.value in clusterid[1]):
if conf.name == 'sp.cluster.id' and (conf.value in clusterid[1]):
return c
@classmethod
@ -399,7 +399,7 @@ class StorPoolHelper():
clusterid = c.id
)
for conf in configuration:
if conf.name == 'sp.cluster.id' and (conf.value not in clusterid[1]):
if conf.name == 'sp.cluster.id' and (conf.value not in clusterid[1]):
return c
@classmethod

View File

@ -338,7 +338,7 @@ class TestPathVMLC(cloudstackTestCase):
# 13. Find suitable host for VM to migrate and migrate the VM
# 14. Verify VM accessibility on new host
"""
if self.hypervisor.lower() in ['hyperv', 'lxc'] and value == VPC_NETWORK:
if self.hypervisor.lower() in ['hyperv', 'lxc'] and value == VPC_NETWORK:
self.skipTest("can't be run for {} hypervisor".format(self.hypervisor))
# List created service offering in setUpClass by name

View File

@ -172,7 +172,7 @@ class DeployDataCenters(object):
def addBaremetalRct(self, config):
networktype= config.zones[0].networktype
baremetalrcturl= config.zones[0].baremetalrcturl
if networktype is None or baremetalrcturl is None:
if networktype is None or baremetalrcturl is None:
return
if networktype.lower()=="advanced":