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 # E227 Missing whitespace around bitwise or shift operator
# E242 Tab after ',' # E242 Tab after ','
# E271 Multiple spaces after keyword # E271 Multiple spaces after keyword
# E272 Multiple spaces before keyword
# E273 Tab after keyword # E273 Tab after keyword
# E274 Tab before keyword # E274 Tab before keyword
# E713 Test for membership should be 'not in' # E713 Test for membership should be 'not in'
@ -39,4 +40,4 @@
exclude = exclude =
.git, .git,
venv 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): def save(self):
fp = open(self.fileName, "r") fp = open(self.fileName, "r")
newLines = [] newLines = []
for line in fp.readlines(): for line in fp.readlines():
matched = False matched = False
for entry in self.entries: for entry in self.entries:
if entry.op == "add": if entry.op == "add":

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2073,7 +2073,7 @@ class TestStoragePool(cloudstackTestCase):
clusterid = c.id clusterid = c.id
) )
for conf in configuration: 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 return c
@classmethod @classmethod
@ -2088,7 +2088,7 @@ class TestStoragePool(cloudstackTestCase):
clusterid = c.id clusterid = c.id
) )
for conf in configuration: 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 return c
@classmethod @classmethod

View File

@ -384,7 +384,7 @@ class StorPoolHelper():
clusterid = c.id clusterid = c.id
) )
for conf in configuration: 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 return c
@classmethod @classmethod
@ -399,7 +399,7 @@ class StorPoolHelper():
clusterid = c.id clusterid = c.id
) )
for conf in configuration: 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 return c
@classmethod @classmethod

View File

@ -338,7 +338,7 @@ class TestPathVMLC(cloudstackTestCase):
# 13. Find suitable host for VM to migrate and migrate the VM # 13. Find suitable host for VM to migrate and migrate the VM
# 14. Verify VM accessibility on new host # 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)) self.skipTest("can't be run for {} hypervisor".format(self.hypervisor))
# List created service offering in setUpClass by name # List created service offering in setUpClass by name

View File

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