Skip to content

Commit 8e53802

Browse files
authored
Enable Flake8 rule W391 (apache#6606)
Best practice is to have one blank line at the end of Python files. Remove unneeded blank lines from the end of files
1 parent e65c22d commit 8e53802

File tree

76 files changed

+7
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+7
-147
lines changed

.github/linters/.flake8

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
# W291 Trailing whitespace
19+
# W292 No newline at end of file
20+
# W293 Blank line contains whitespace
21+
# W391 Blank line at end of file
22+
1823
[flake8]
19-
select = W291,W292,W293
24+
select = W291,W292,W293,W391

cloud-cli/cloudapis/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ def lookup_api(api_name):
4040
else: api = matchingapi[0]
4141
if api: api = getattr(api,"implementor")
4242
return api
43-

cloud-cli/cloudapis/cloud.py

-2
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,3 @@ def %s(%s):
194194
implementor = CloudAPI
195195

196196
del name,meth,describe,load_dynamic_methods
197-
198-

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

-1
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,3 @@ def backup(self):
172172
self.add_lines(oldLine, False)
173173
else:
174174
self.replace_lines(newLine, oldLine, False)
175-

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

-1
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,3 @@ def makeOwnerFileName():
156156
hostIp = successToMap(get_master_ip())['ip']
157157
ownerFileName = OWNER_FILE_PREFIX + hostIp.replace('.', '_')
158158
return ownerFileName
159-

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

-1
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,3 @@ def setupHeartBeat():
102102
stopOldHeartBeat(pid)
103103

104104
setupHeartBeat()
105-

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

-1
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,3 @@ def _start(self, cluster):
7777
doCmd(cmd)
7878
cmd = ['service o2cb start %s'%cluster]
7979
doCmd(cmd)
80-

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

-38
Original file line numberDiff line numberDiff line change
@@ -438,41 +438,3 @@ def check_rule_log_for_vm(vm_name, vm_id, vm_ip, dom_id, signature, seqno):
438438
return [True, True, True, True, True, True]
439439

440440
return [(vm_name != _vm_name), (vm_id != _vm_id), (vm_ip != _vm_ip), (dom_id != _dom_id), (signature != _signature), (seqno != _seqno)]
441-
442-
443-
444-
445-
446-
447-
448-
449-
450-
451-
452-
453-
454-
455-
456-
457-
458-
459-
460-
461-
462-
463-
464-
465-
466-
467-
468-
469-
470-
471-
472-
473-
474-
475-
476-
477-
478-

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

-2
Original file line numberDiff line numberDiff line change
@@ -427,5 +427,3 @@ def copyToPrimary(secMountPoint, volumeFolderOnSecStorage, volumePath, primaryMo
427427
errmsg = fmt_err_msg(e)
428428
logger.error(OvmStoragePool.copyVolume, errmsg)
429429
raise XmlRpcFault(toErrCode(OvmStoragePool, OvmStoragePool.copyVolume), errmsg)
430-
431-

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

-3
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,3 @@ def destroy(poolUuid, path):
153153

154154
if __name__ == "__main__":
155155
print OvmVolume.detachOrAttachIso(sys.argv[1], '', False)
156-
157-
158-

python/lib/cloud_utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -679,4 +679,3 @@ def commit(self):raise NotImplementedError
679679
def rollback(self):raise NotImplementedError
680680
def get_schema_level(self):raise NotImplementedError
681681
def set_schema_level(self,l):raise NotImplementedError
682-

python/lib/cloudutils/networkConfig.py

-1
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,3 @@ def getDevInfo(dev):
163163
type = "dev"
164164

165165
return networkConfig.devInfo(macAddr, ipAddr, netmask, None, type, dev)
166-

scripts/network/exdhcp/dhcpd_edithosts.py

-1
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,3 @@ def insert_host_entry(mac, ip, hostname, dns, gateway, next_server):
120120

121121
ret = insert_host_entry(mac, ip, hostname, dns, gateway, next_server)
122122
sys.exit(ret)
123-

scripts/network/ping/prepare_kickstart_kernel_initrd.py

-1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,3 @@ def copy_from_nfs(src, dst):
7272

7373
(kernel, initrd, copy_to) = sys.argv[1:]
7474
sys.exit(prepare())
75-

scripts/vm/hypervisor/xenserver/perfmon.py

-1
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,3 @@ def get_vm_group_perfmon(args={}):
258258
else:
259259
result += ',' + str(vm_count) + '.' + str(counter_count) + ':' + str(average_memory)
260260
return result
261-

scripts/vm/network/vnet/ovstunnel.py

-1
Original file line numberDiff line numberDiff line change
@@ -309,4 +309,3 @@ def get_field_of_interface(iface_name, field):
309309
else:
310310
logging.debug("Unknown command: " + cmd)
311311
sys.exit(1)
312-

test/integration/broken/test_ps_resource_limits_volume.py

-1
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,3 @@ def test_attach_volume_exceeding_primary_limits(self):
169169
self.assertEqual(response[0], PASS, response[1])
170170

171171
return
172-

test/integration/broken/test_vr_metadata.py

-1
Original file line numberDiff line numberDiff line change
@@ -334,4 +334,3 @@ def test_deployVM_verify_metadata_in_VR_after_migration(self):
334334
)
335335

336336
return
337-

test/integration/component/maint/test_ip_resource_count_for_vpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -349,5 +349,3 @@ def test_01_ip_resource_count_vpc_network(self):
349349
account_list = Account.list(self.apiclient, id=self.account.id)
350350
totalip = account_list[0].iptotal
351351
self.assertTrue(totalip - totalip_1 == 3, "publicip count is 3")
352-
353-

test/integration/component/test_acl_isolatednetwork_delete.py

-1
Original file line numberDiff line numberDiff line change
@@ -546,4 +546,3 @@ def createNetwork(cls,apiclient,account,isolated_network_offering_id,zone):
546546
)
547547
cls._cleanup.append(network)
548548
return network
549-

test/integration/component/test_acl_sharednetwork.py

-2
Original file line numberDiff line numberDiff line change
@@ -1124,5 +1124,3 @@ def generateKeysForUser(apiclient,account):
11241124
apiclient,
11251125
user.id
11261126
))
1127-
1128-

test/integration/component/test_affinity_groups_projects.py

-3
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,3 @@ def test_02_deploy_vm_anti_affinity_group_fail_on_not_enough_hosts(self):
10821082

10831083
wait_for_cleanup(self.api_client, ["expunge.delay", "expunge.interval"])
10841084
self.cleanup.append(aff_grp)
1085-
1086-
1087-

test/integration/component/test_baremetal.py

-1
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,3 @@ def test_baremetal(self):
120120
cmd.endip = "10.1.1.40"
121121
cmd.forVirtualNetwork="false"
122122
self.apiclient.createVlanIpRange(cmd)
123-

test/integration/component/test_brocade_vcs.py

-1
Original file line numberDiff line numberDiff line change
@@ -329,4 +329,3 @@ def test_network_vcs(self):
329329
Network.delete(self.network, self.apiclient)
330330

331331
return
332-

test/integration/component/test_concurrent_create_volume_from_snapshot.py

-1
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,3 @@ def test_01_snapshot_root_disk(self):
303303
)
304304

305305
return
306-

test/integration/component/test_dhcp_dns_offload.py

-1
Original file line numberDiff line numberDiff line change
@@ -2124,4 +2124,3 @@ def test_33_verify_config_params_TC65(self):
21242124
self.debug("Success: Updating dhcp config params with invalid values is not allowed\
21252125
and throws following message: %s" % e)
21262126
return
2127-

test/integration/component/test_egress_rules.py

-3
Original file line numberDiff line numberDiff line change
@@ -2125,6 +2125,3 @@ def test_invalid_parameters(self):
21252125
domainid=self.account.domainid
21262126
)
21272127
return
2128-
2129-
2130-

test/integration/component/test_escalations_instances.py

-3
Original file line numberDiff line numberDiff line change
@@ -4492,6 +4492,3 @@ def test_25_ip_reallocation_ES1377(self):
44924492
"Warning: Exception in expunging vms vm3 and vm4 : %s" %
44934493
e)
44944494
return
4495-
4496-
4497-

test/integration/component/test_escalations_templates.py

-3
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,3 @@ def test_04_copy_template(self):
861861
)
862862
del self.services["privatetemplate"]["ostype"]
863863
return
864-
865-
866-

test/integration/component/test_escalations_vmware.py

-3
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,3 @@ def test_04_check_vm_snapshot_creation_after_Instance_creation(self):
367367
snapshot_created_1,
368368
"VM Snapshot creation failed"
369369
)
370-
371-
372-

test/integration/component/test_hypervisor_capabilities.py

-1
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,3 @@ def listHostHypervisorCapabilities(self, id, hypervisor=None):
286286
cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
287287
cmd.id = id
288288
return self.apiclient.listHypervisorCapabilities(cmd)
289-

test/integration/component/test_invalid_gw_nm.py

-1
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,3 @@ def test_isolated_nw_invalid_gw(self):
124124
netmask="255.0.255.0",
125125
)
126126
return
127-

test/integration/component/test_ldap.py

-1
Original file line numberDiff line numberDiff line change
@@ -304,4 +304,3 @@ def _checklogin(self, username, password):
304304
except Exception as p:
305305
self.debug("login operation failed %s" % p)
306306
self.reason = "Login operation Failed %s" % p
307-

test/integration/component/test_ldap_auto_import.py

-2
Original file line numberDiff line numberDiff line change
@@ -594,5 +594,3 @@ def test_11_ldap(self):
594594
"", "", self.parent_domain.name, method="POST")
595595
self.debug(loginRes)
596596
self.assertEqual(loginRes, None, self.reason)
597-
598-

test/integration/component/test_multiple_nic_support.py

-1
Original file line numberDiff line numberDiff line change
@@ -621,4 +621,3 @@ def test_09_reboot_vm_with_multiple_nic(self):
621621
self.fail("Exception occurred: %s" % e)
622622

623623
self.verify_network_rules(self.virtual_machine1.id)
624-

test/integration/component/test_redundant_router_services.py

-1
Original file line numberDiff line numberDiff line change
@@ -380,4 +380,3 @@ def test_enableVPNOverRvR(self):
380380
"List remote VPNs should not return empty response"
381381
)
382382
return
383-

test/integration/plugins/solidfire/TestAddRemoveHosts.py

-1
Original file line numberDiff line numberDiff line change
@@ -955,4 +955,3 @@ def _connect_to_hypervisor(cls):
955955
xen_server = cls.testdata[TestData.xenServer]
956956

957957
cls.xen_session.xenapi.login_with_password(xen_server[TestData.username], xen_server[TestData.password])
958-

test/integration/plugins/solidfire/TestManagedSystemVMs.py

-1
Original file line numberDiff line numberDiff line change
@@ -624,4 +624,3 @@ def _connect_to_hypervisor(cls):
624624
xen_server = cls.testdata[TestData.xenServer]
625625

626626
cls.xen_session.xenapi.login_with_password(xen_server[TestData.username], xen_server[TestData.password])
627-

test/integration/plugins/solidfire/TestSnapshots.py

-1
Original file line numberDiff line numberDiff line change
@@ -1767,4 +1767,3 @@ def _delete_and_test_snapshot_2(self, vol_snap, sf_account_id, expected_num_volu
17671767
sf_volumes = sf_util.get_active_sf_volumes(self.sfe, sf_account_id)
17681768

17691769
sf_util.check_list(sf_volumes, expected_num_volumes, self, volume_err_msg)
1770-

test/integration/plugins/solidfire/TestVolumes.py

-1
Original file line numberDiff line numberDiff line change
@@ -2710,4 +2710,3 @@ def _connect_to_hypervisor(cls):
27102710
xen_server = cls.testdata[TestData.xenServer]
27112711

27122712
cls.xen_session.xenapi.login_with_password(xen_server[TestData.username], xen_server[TestData.password])
2713-

test/integration/plugins/storpool/TestStorPoolVolumes.py

-2
Original file line numberDiff line numberDiff line change
@@ -2149,5 +2149,3 @@ def getCfgFromUrl(cls, url):
21492149
host, port = cfg['SP_API_HTTP'].split(':')
21502150
auth = cfg['SP_AUTH_TOKEN']
21512151
return host, int(port), auth
2152-
2153-

test/integration/plugins/storpool/sp_util.py

-1
Original file line numberDiff line numberDiff line change
@@ -745,4 +745,3 @@ def start(cls, apiclient, vmid, hostid):
745745
cmd.id = vmid
746746
cmd.hostid = hostid
747747
return (apiclient.startVirtualMachine(cmd))
748-

test/integration/smoke/test_create_network.py

-1
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,3 @@ def test_02_create_network_with_same_name(self):
289289
)
290290

291291
self.cleanup.append(self.network_offering)
292-

test/integration/smoke/test_deploy_vm_root_resize.py

-3
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,3 @@ def test_02_deploy_vm_root_resize(self):
394394
self.assertEqual(success, True, "Check if passing rootdisksize < templatesize fails appropriately")
395395
else:
396396
self.debug("test 02 does not support hypervisor type " + self.hypervisor)
397-
398-
399-

test/integration/smoke/test_enable_role_based_users_in_projects.py

-1
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,3 @@ def test_add_multiple_admins_in_project(self):
268268
)
269269
except Exception as e:
270270
pass
271-

test/integration/smoke/test_metrics_api.py

-1
Original file line numberDiff line numberDiff line change
@@ -376,4 +376,3 @@ def valid_date(cls, date_text):
376376
return True
377377
except ValueError:
378378
return False
379-

test/integration/smoke/test_network_permissions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -791,4 +791,4 @@ def test_06_list_networks_under_account(self):
791791

792792
self.remove_network_permission(self.apiclient, self.user_network, self.other_user, None, expected=True)
793793
self.list_network(self.apiclient, self.other_user, self.user_network, None, None, expected=False)
794-
self.list_network(self.otheruser_apiclient, self.other_user, self.user_network, None, None, expected=False)
794+
self.list_network(self.otheruser_apiclient, self.other_user, self.user_network, None, None, expected=False)

test/integration/smoke/test_non_contigiousvlan.py

-1
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,3 @@ def tearDown(self):
8888
updateResponse = self.network.update(self.apiClient, id = self.networkid, vlan=self.existing_vlan)
8989
self.assertTrue(updateResponse.vlan.find(self.vlan["full_range"]) < 0,
9090
"VLAN was not removed successfully")
91-

test/integration/testpaths/testpath_delta_snapshots.py

-1
Original file line numberDiff line numberDiff line change
@@ -537,4 +537,3 @@ def test_01_delta_snapshots(self):
537537
"Check: Snapshot 1 is still on Secondary Storage. Not Deleted.")
538538

539539
return
540-

test/selenium/browser/firefox.py

-1
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,3 @@ def quit_browser(self):
5353
browser.set_url("http://10.88.90.84:8080/client/")
5454
time.sleep(3)
5555
browser.quit_browser()
56-

test/selenium/common/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
18-

test/selenium/common/shared.py

-1
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,3 @@ def wait_for_invisible(browser, element_type, name, waittime=30):
146146

147147
#this method isn't as slick as I hoped :(
148148
time.sleep(1)
149-

test/selenium/cspages/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
18-

test/selenium/cspages/cspage.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@
1818
class CloudStackPage(object):
1919
def __init__():
2020
self.browser = None
21-

test/selenium/cspages/dashboard/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
18-

test/selenium/cspages/dashboard/dashboardpage.py

-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,3 @@ def navigate_to(self, item_name):
7171
li.click()
7272
time.sleep(3)
7373
return
74-

test/selenium/cspages/login/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
18-

test/selenium/cstests/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-

test/selenium/cstests/regressiontests/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-

test/selenium/cstests/smoketests/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-

test/selenium/cstests/smoketests/smokecfg.py

-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,3 @@
6060
},
6161

6262
}
63-

test/selenium/lib/Global_Locators.py

-2
Original file line numberDiff line numberDiff line change
@@ -220,5 +220,3 @@
220220

221221
# Click ok to login
222222
login_submit_css = "body.login > div.login > form > div.fields > input[type=\"submit\"]" # Login>Login Button (Submit button)
223-
224-

test/selenium/smoke/main.py

-3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,3 @@
140140

141141
# Leave following as is for either XML or HTML
142142
runner.run(suite)
143-
144-
145-

tools/marvin/marvin/cloudstackException.py

-1
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,3 @@ def verifyErrorCodeinException(e,errorCode):
9292
return True
9393
else:
9494
return False
95-

tools/marvin/marvin/lib/utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -551,4 +551,3 @@ def wait_until(retry_interval=2, no_of_times=2, callback=None, *callback_args):
551551
break
552552

553553
return wait_result, return_val
554-

0 commit comments

Comments
 (0)