Enable Flake8 rule W391 (#6606)

Best practice is to have one blank line at the end of Python files.

Remove unneeded blank lines from the end of files
This commit is contained in:
John Bampton 2022-11-13 20:00:07 +10:00 committed by GitHub
parent e65c22d883
commit 8e538028b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
76 changed files with 7 additions and 147 deletions

View File

@ -15,5 +15,10 @@
# specific language governing permissions and limitations
# under the License.
# W291 Trailing whitespace
# W292 No newline at end of file
# W293 Blank line contains whitespace
# W391 Blank line at end of file
[flake8]
select = W291,W292,W293
select = W291,W292,W293,W391

View File

@ -40,4 +40,3 @@ def lookup_api(api_name):
else: api = matchingapi[0]
if api: api = getattr(api,"implementor")
return api

View File

@ -194,5 +194,3 @@ for name,meth in load_dynamic_methods():
implementor = CloudAPI
del name,meth,describe,load_dynamic_methods

View File

@ -172,4 +172,3 @@ class ConfigFileOps:
self.add_lines(oldLine, False)
else:
self.replace_lines(newLine, oldLine, False)

View File

@ -156,4 +156,3 @@ def makeOwnerFileName():
hostIp = successToMap(get_master_ip())['ip']
ownerFileName = OWNER_FILE_PREFIX + hostIp.replace('.', '_')
return ownerFileName

View File

@ -102,4 +102,3 @@ class OvmHaHeartBeat(object):
stopOldHeartBeat(pid)
setupHeartBeat()

View File

@ -77,4 +77,3 @@ EOF
doCmd(cmd)
cmd = ['service o2cb start %s'%cluster]
doCmd(cmd)

View File

@ -438,41 +438,3 @@ class OvmSecurityGroup(OvmObject):
return [True, True, True, True, True, True]
return [(vm_name != _vm_name), (vm_id != _vm_id), (vm_ip != _vm_ip), (dom_id != _dom_id), (signature != _signature), (seqno != _seqno)]

View File

@ -427,5 +427,3 @@ if this doesn't resolve the problem, please check oracle manual to see how to of
errmsg = fmt_err_msg(e)
logger.error(OvmStoragePool.copyVolume, errmsg)
raise XmlRpcFault(toErrCode(OvmStoragePool, OvmStoragePool.copyVolume), errmsg)

View File

@ -153,6 +153,3 @@ class OvmVolume(OvmObject):
if __name__ == "__main__":
print OvmVolume.detachOrAttachIso(sys.argv[1], '', False)

View File

@ -679,4 +679,3 @@ class MigrationContext:
def rollback(self):raise NotImplementedError
def get_schema_level(self):raise NotImplementedError
def set_schema_level(self,l):raise NotImplementedError

View File

@ -163,4 +163,3 @@ class networkConfig:
type = "dev"
return networkConfig.devInfo(macAddr, ipAddr, netmask, None, type, dev)

View File

@ -120,4 +120,3 @@ if __name__ == "__main__":
ret = insert_host_entry(mac, ip, hostname, dns, gateway, next_server)
sys.exit(ret)

View File

@ -72,4 +72,3 @@ if __name__ == "__main__":
(kernel, initrd, copy_to) = sys.argv[1:]
sys.exit(prepare())

View File

@ -258,4 +258,3 @@ def get_vm_group_perfmon(args={}):
else:
result += ',' + str(vm_count) + '.' + str(counter_count) + ':' + str(average_memory)
return result

View File

@ -309,4 +309,3 @@ if __name__ == '__main__':
else:
logging.debug("Unknown command: " + cmd)
sys.exit(1)

View File

@ -169,4 +169,3 @@ class TestPrimaryResourceLimitsVolume(cloudstackTestCase):
self.assertEqual(response[0], PASS, response[1])
return

View File

@ -334,4 +334,3 @@ class TestDeployVmWithMetaData(cloudstackTestCase):
)
return

View File

@ -349,5 +349,3 @@ class TestIPResourceCountVPC(cloudstackTestCase):
account_list = Account.list(self.apiclient, id=self.account.id)
totalip = account_list[0].iptotal
self.assertTrue(totalip - totalip_1 == 3, "publicip count is 3")

View File

@ -546,4 +546,3 @@ class TestIsolatedNetworkDelete(cloudstackTestCase):
)
cls._cleanup.append(network)
return network

View File

@ -1124,5 +1124,3 @@ class TestSharedNetwork(cloudstackTestCase):
apiclient,
user.id
))

View File

@ -1082,6 +1082,3 @@ class TestDeployVMAffinityGroups(cloudstackTestCase):
wait_for_cleanup(self.api_client, ["expunge.delay", "expunge.interval"])
self.cleanup.append(aff_grp)

View File

@ -120,4 +120,3 @@ class TestBaremetal(cloudstackTestCase):
cmd.endip = "10.1.1.40"
cmd.forVirtualNetwork="false"
self.apiclient.createVlanIpRange(cmd)

View File

@ -329,4 +329,3 @@ class TestBrocadeVcs(cloudstackTestCase):
Network.delete(self.network, self.apiclient)
return

View File

@ -303,4 +303,3 @@ class TestSnapshotRootDisk(cloudstackTestCase):
)
return

View File

@ -2124,4 +2124,3 @@ class TestDeployVMs(cloudstackTestCase):
self.debug("Success: Updating dhcp config params with invalid values is not allowed\
and throws following message: %s" % e)
return

View File

@ -2125,6 +2125,3 @@ class TestInvalidParametersForEgress(cloudstackTestCase):
domainid=self.account.domainid
)
return

View File

@ -4492,6 +4492,3 @@ class TestInstances(cloudstackTestCase):
"Warning: Exception in expunging vms vm3 and vm4 : %s" %
e)
return

View File

@ -861,6 +861,3 @@ class TestTemplates(cloudstackTestCase):
)
del self.services["privatetemplate"]["ostype"]
return

View File

@ -367,6 +367,3 @@ class TestVMware(cloudstackTestCase):
snapshot_created_1,
"VM Snapshot creation failed"
)

View File

@ -286,4 +286,3 @@ class TestHypervisorCapabilities(cloudstackTestCase):
cmd = listHypervisorCapabilities.listHypervisorCapabilitiesCmd()
cmd.id = id
return self.apiclient.listHypervisorCapabilities(cmd)

View File

@ -124,4 +124,3 @@ class TestIsolatedNetworkInvalidGw(cloudstackTestCase):
netmask="255.0.255.0",
)
return

View File

@ -304,4 +304,3 @@ class TestLdap(cloudstackTestCase):
except Exception as p:
self.debug("login operation failed %s" % p)
self.reason = "Login operation Failed %s" % p

View File

@ -594,5 +594,3 @@ class TestLdap(cloudstackTestCase):
"", "", self.parent_domain.name, method="POST")
self.debug(loginRes)
self.assertEqual(loginRes, None, self.reason)

View File

@ -621,4 +621,3 @@ class TestMulipleNicSupport(cloudstackTestCase):
self.fail("Exception occurred: %s" % e)
self.verify_network_rules(self.virtual_machine1.id)

View File

@ -380,4 +380,3 @@ class TestEnableVPNOverRvR(cloudstackTestCase):
"List remote VPNs should not return empty response"
)
return

View File

@ -955,4 +955,3 @@ class TestAddRemoveHosts(cloudstackTestCase):
xen_server = cls.testdata[TestData.xenServer]
cls.xen_session.xenapi.login_with_password(xen_server[TestData.username], xen_server[TestData.password])

View File

@ -624,4 +624,3 @@ class TestManagedSystemVMs(cloudstackTestCase):
xen_server = cls.testdata[TestData.xenServer]
cls.xen_session.xenapi.login_with_password(xen_server[TestData.username], xen_server[TestData.password])

View File

@ -1767,4 +1767,3 @@ class TestSnapshots(cloudstackTestCase):
sf_volumes = sf_util.get_active_sf_volumes(self.sfe, sf_account_id)
sf_util.check_list(sf_volumes, expected_num_volumes, self, volume_err_msg)

View File

@ -2710,4 +2710,3 @@ class TestVolumes(cloudstackTestCase):
xen_server = cls.testdata[TestData.xenServer]
cls.xen_session.xenapi.login_with_password(xen_server[TestData.username], xen_server[TestData.password])

View File

@ -2149,5 +2149,3 @@ class TestStoragePool(cloudstackTestCase):
host, port = cfg['SP_API_HTTP'].split(':')
auth = cfg['SP_AUTH_TOKEN']
return host, int(port), auth

View File

@ -745,4 +745,3 @@ class StorPoolHelper():
cmd.id = vmid
cmd.hostid = hostid
return (apiclient.startVirtualMachine(cmd))

View File

@ -289,4 +289,3 @@ class TestNetworkManagement(cloudstackTestCase):
)
self.cleanup.append(self.network_offering)

View File

@ -394,6 +394,3 @@ class TestDeployVmRootSize(cloudstackTestCase):
self.assertEqual(success, True, "Check if passing rootdisksize < templatesize fails appropriately")
else:
self.debug("test 02 does not support hypervisor type " + self.hypervisor)

View File

@ -268,4 +268,3 @@ class TestRoleBasedUsersInProjects(cloudstackTestCase):
)
except Exception as e:
pass

View File

@ -376,4 +376,3 @@ class TestMetrics(cloudstackTestCase):
return True
except ValueError:
return False

View File

@ -791,4 +791,4 @@ class TestNetworkPermissions(cloudstackTestCase):
self.remove_network_permission(self.apiclient, self.user_network, self.other_user, None, expected=True)
self.list_network(self.apiclient, self.other_user, self.user_network, None, None, expected=False)
self.list_network(self.otheruser_apiclient, self.other_user, self.user_network, None, None, expected=False)
self.list_network(self.otheruser_apiclient, self.other_user, self.user_network, None, None, expected=False)

View File

@ -88,4 +88,3 @@ class TestUpdatePhysicalNetwork(cloudstackTestCase):
updateResponse = self.network.update(self.apiClient, id = self.networkid, vlan=self.existing_vlan)
self.assertTrue(updateResponse.vlan.find(self.vlan["full_range"]) < 0,
"VLAN was not removed successfully")

View File

@ -537,4 +537,3 @@ class TestDeltaSnapshots(cloudstackTestCase):
"Check: Snapshot 1 is still on Secondary Storage. Not Deleted.")
return

View File

@ -53,4 +53,3 @@ if __name__ == "__main__":
browser.set_url("http://10.88.90.84:8080/client/")
time.sleep(3)
browser.quit_browser()

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -146,4 +146,3 @@ class Shared(object):
#this method isn't as slick as I hoped :(
time.sleep(1)

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -18,4 +18,3 @@
class CloudStackPage(object):
def __init__():
self.browser = None

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -71,4 +71,3 @@ class DashboardPage(CloudStackPage):
li.click()
time.sleep(3)
return

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -60,4 +60,3 @@ smokecfg = {
},
}

View File

@ -220,5 +220,3 @@ login_password_css = "body.login > div.login > form > div.fields > div.field.pas
# Click ok to login
login_submit_css = "body.login > div.login > form > div.fields > input[type=\"submit\"]" # Login>Login Button (Submit button)

View File

@ -140,6 +140,3 @@ runner = xmlrunner.XMLTestRunner(output='test-reports')
# Leave following as is for either XML or HTML
runner.run(suite)

View File

@ -92,4 +92,3 @@ class CloudstackAclException():
return True
else:
return False

View File

@ -551,4 +551,3 @@ def wait_until(retry_interval=2, no_of_times=2, callback=None, *callback_args):
break
return wait_result, return_val

View File

@ -145,4 +145,3 @@ class bash:
return self.getStdout()
else:
return self.getStderr()

View File

@ -50,4 +50,3 @@ if __name__ == '__main__':
timeout = timeout - 1
if tn is None:
raise socket.error("Unable to reach API port")

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@ -14,5 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.