Skip to content

Commit 806692b

Browse files
authored
pre-commit: enable Python flake8 rule E272 (#9361)
There should be only one space before a keyword.
1 parent c6d3f6e commit 806692b

File tree

11 files changed

+20
-19
lines changed

11 files changed

+20
-19
lines changed

.github/linters/.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
# E227 Missing whitespace around bitwise or shift operator
2424
# E242 Tab after ','
2525
# E271 Multiple spaces after keyword
26+
# E272 Multiple spaces before keyword
2627
# E273 Tab after keyword
2728
# E274 Tab before keyword
2829
# E713 Test for membership should be 'not in'
@@ -39,4 +40,4 @@
3940
exclude =
4041
.git,
4142
venv
42-
select = E112,E113,E133,E223,E224,E227,E242,E271,E273,E274,E713,E742,E743,E901,E902,W291,W292,W293,W391
43+
select = E112,E113,E133,E223,E224,E227,E242,E271,E272,E273,E274,E713,E742,E743,E901,E902,W291,W292,W293,W391

plugins/hypervisors/ovm/src/main/scripts/vm/hypervisor/ovm/ConfigFileOps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def getEntry(self, name, separator="="):
5858
def save(self):
5959
fp = open(self.fileName, "r")
6060
newLines = []
61-
for line in fp.readlines():
61+
for line in fp.readlines():
6262
matched = False
6363
for entry in self.entries:
6464
if entry.op == "add":

python/lib/cloudutils/configFileOps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def save(self):
6363
newLines = []
6464
if os.path.exists(self.fileName) and os.path.isfile(self.fileName):
6565
fp = open(self.fileName, "r")
66-
for line in fp.readlines():
66+
for line in fp.readlines():
6767
matched = False
6868
for entry in self.entries:
6969
if entry.op == "add":

scripts/vm/network/security_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ def cleanup_rules():
938938
vmpresent = False
939939

940940
for vm in vmsInHost:
941-
if vm_name in vm:
941+
if vm_name in vm:
942942
vmpresent = True
943943
break
944944

@@ -958,7 +958,7 @@ def cleanup_rules():
958958
vm_name = chain
959959
vmpresent = False
960960
for vm in vmsInHost:
961-
if vm_name in vm:
961+
if vm_name in vm:
962962
vmpresent = True
963963
break
964964

systemvm/debian/opt/cloud/bin/passwd_server_ip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
import threading
3434
import urllib.parse
3535

36-
from http.server import BaseHTTPRequestHandler, HTTPServer
37-
from socketserver import ThreadingMixIn #, ForkingMixIn
36+
from http.server import BaseHTTPRequestHandler, HTTPServer
37+
from socketserver import ThreadingMixIn #, ForkingMixIn
3838

3939

4040
passMap = {}

test/integration/component/test_assign_vm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"""
1919
"""
2020
#Import Local Modules
21-
from nose.plugins.attrib import attr
22-
from marvin.cloudstackTestCase import cloudstackTestCase
23-
from marvin.lib.base import (Account,
21+
from nose.plugins.attrib import attr
22+
from marvin.cloudstackTestCase import cloudstackTestCase
23+
from marvin.lib.base import (Account,
2424
Domain,
2525
User,
2626
Project,

test/integration/component/test_egress_fw_rules.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"""
1919
"""
2020
#Import Local Modules
21-
from nose.plugins.attrib import attr
22-
from marvin.cloudstackTestCase import cloudstackTestCase
21+
from nose.plugins.attrib import attr
22+
from marvin.cloudstackTestCase import cloudstackTestCase
2323
import unittest
24-
from marvin.lib.base import (Account,
24+
from marvin.lib.base import (Account,
2525
Domain,
2626
Router,
2727
Network,

test/integration/plugins/storpool/TestStorPoolVolumes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,7 +2073,7 @@ def get_local_cluster(cls):
20732073
clusterid = c.id
20742074
)
20752075
for conf in configuration:
2076-
if conf.name == 'sp.cluster.id' and (conf.value in clusterid[1]):
2076+
if conf.name == 'sp.cluster.id' and (conf.value in clusterid[1]):
20772077
return c
20782078

20792079
@classmethod
@@ -2088,7 +2088,7 @@ def get_remote_cluster(cls):
20882088
clusterid = c.id
20892089
)
20902090
for conf in configuration:
2091-
if conf.name == 'sp.cluster.id' and (conf.value not in clusterid[1]):
2091+
if conf.name == 'sp.cluster.id' and (conf.value not in clusterid[1]):
20922092
return c
20932093

20942094
@classmethod

test/integration/plugins/storpool/sp_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def get_local_cluster(cls, apiclient, zoneid):
384384
clusterid = c.id
385385
)
386386
for conf in configuration:
387-
if conf.name == 'sp.cluster.id' and (conf.value in clusterid[1]):
387+
if conf.name == 'sp.cluster.id' and (conf.value in clusterid[1]):
388388
return c
389389

390390
@classmethod
@@ -399,7 +399,7 @@ def get_remote_cluster(cls, apiclient, zoneid):
399399
clusterid = c.id
400400
)
401401
for conf in configuration:
402-
if conf.name == 'sp.cluster.id' and (conf.value not in clusterid[1]):
402+
if conf.name == 'sp.cluster.id' and (conf.value not in clusterid[1]):
403403
return c
404404

405405
@classmethod

test/integration/testpaths/testpath_vmlc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def test_01_positive_tests_vm_operations_advanced_zone(self, value):
338338
# 13. Find suitable host for VM to migrate and migrate the VM
339339
# 14. Verify VM accessibility on new host
340340
"""
341-
if self.hypervisor.lower() in ['hyperv', 'lxc'] and value == VPC_NETWORK:
341+
if self.hypervisor.lower() in ['hyperv', 'lxc'] and value == VPC_NETWORK:
342342
self.skipTest("can't be run for {} hypervisor".format(self.hypervisor))
343343

344344
# List created service offering in setUpClass by name

0 commit comments

Comments
 (0)