mirror of https://github.com/apache/cloudstack.git
.github/linters: Enable flake8 W293 blank line contains whitespace (#6268)
https://www.flake8rules.com/rules/W293.html
This commit is contained in:
parent
50b2dc2789
commit
cfa4f33940
|
|
@ -16,4 +16,4 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
select = W291
|
select = W291,W293
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ class TestMigrateVolumeToAnotherPool(cloudstackTestCase):
|
||||||
cls.storage_pool = StoragePool.update(cls.apiclient,
|
cls.storage_pool = StoragePool.update(cls.apiclient,
|
||||||
id=cls.storage_pool.id,
|
id=cls.storage_pool.id,
|
||||||
tags = ["ssd, nfs"])
|
tags = ["ssd, nfs"])
|
||||||
|
|
||||||
|
|
||||||
if template == FAILED:
|
if template == FAILED:
|
||||||
assert False, "get_template() failed to return template\
|
assert False, "get_template() failed to return template\
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ class TestStoragePool(cloudstackTestCase):
|
||||||
cls.apiclient,
|
cls.apiclient,
|
||||||
name="Large"
|
name="Large"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
cls.disk_offerings = disk_offerings[0]
|
cls.disk_offerings = disk_offerings[0]
|
||||||
cls.disk_offering_20 = disk_offering_20[0]
|
cls.disk_offering_20 = disk_offering_20[0]
|
||||||
|
|
@ -824,7 +824,7 @@ class TestStoragePool(cloudstackTestCase):
|
||||||
flag = True
|
flag = True
|
||||||
except spapi.ApiError as err:
|
except spapi.ApiError as err:
|
||||||
flag = False
|
flag = False
|
||||||
|
|
||||||
if flag is True:
|
if flag is True:
|
||||||
raise Exception("Snapshot was not deleted")
|
raise Exception("Snapshot was not deleted")
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
|
@ -913,12 +913,12 @@ class TestStoragePool(cloudstackTestCase):
|
||||||
flag = True
|
flag = True
|
||||||
except spapi.ApiError as err:
|
except spapi.ApiError as err:
|
||||||
flag = False
|
flag = False
|
||||||
|
|
||||||
if flag is True:
|
if flag is True:
|
||||||
raise Exception("Snapshot was not deleted")
|
raise Exception("Snapshot was not deleted")
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.debug('Snapshot was deleted %s' % err)
|
self.debug('Snapshot was deleted %s' % err)
|
||||||
|
|
||||||
|
|
||||||
Template.delete(template, self.apiclient, zoneid = self.zone.id)
|
Template.delete(template, self.apiclient, zoneid = self.zone.id)
|
||||||
|
|
||||||
|
|
@ -1744,7 +1744,7 @@ class TestStoragePool(cloudstackTestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertIsNotNone(self.volume, "Detach: Is none")
|
self.assertIsNotNone(self.volume, "Detach: Is none")
|
||||||
|
|
||||||
snapshot = Snapshot.create(
|
snapshot = Snapshot.create(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
self.volume.id,
|
self.volume.id,
|
||||||
|
|
@ -2052,10 +2052,10 @@ class TestStoragePool(cloudstackTestCase):
|
||||||
|
|
||||||
if snapshotid:
|
if snapshotid:
|
||||||
cmd.snapshotid = snapshotid
|
cmd.snapshotid = snapshotid
|
||||||
|
|
||||||
if account:
|
if account:
|
||||||
cmd.account=account
|
cmd.account=account
|
||||||
|
|
||||||
if domainid:
|
if domainid:
|
||||||
cmd.domainid=domainid
|
cmd.domainid=domainid
|
||||||
return Volume(apiclient.createVolume(cmd).__dict__)
|
return Volume(apiclient.createVolume(cmd).__dict__)
|
||||||
|
|
@ -2150,4 +2150,4 @@ class TestStoragePool(cloudstackTestCase):
|
||||||
auth = cfg['SP_AUTH_TOKEN']
|
auth = cfg['SP_AUTH_TOKEN']
|
||||||
return host, int(port), auth
|
return host, int(port), auth
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -480,7 +480,7 @@ class TestStoragePool(cloudstackTestCase):
|
||||||
self.debug('list_snapshot_response -------------------- %s' % list_snapshot_response)
|
self.debug('list_snapshot_response -------------------- %s' % list_snapshot_response)
|
||||||
|
|
||||||
self.assertIsNone(list_snapshot_response, "snapshot is already deleted")
|
self.assertIsNone(list_snapshot_response, "snapshot is already deleted")
|
||||||
|
|
||||||
|
|
||||||
@attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
|
@attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true")
|
||||||
def test_06_remove_vcpolicy_tag_when_disk_detached(self):
|
def test_06_remove_vcpolicy_tag_when_disk_detached(self):
|
||||||
|
|
|
||||||
|
|
@ -410,16 +410,16 @@ class StorPoolHelper():
|
||||||
""" Get destination pool which has scope same as migrateto
|
""" Get destination pool which has scope same as migrateto
|
||||||
and which is not in avoid set
|
and which is not in avoid set
|
||||||
"""
|
"""
|
||||||
|
|
||||||
destinationPool = None
|
destinationPool = None
|
||||||
|
|
||||||
# Get Storage Pool Id to migrate to
|
# Get Storage Pool Id to migrate to
|
||||||
for storagePool in pools:
|
for storagePool in pools:
|
||||||
if storagePool.scope == migrateto:
|
if storagePool.scope == migrateto:
|
||||||
if storagePool.name not in poolsToavoid:
|
if storagePool.name not in poolsToavoid:
|
||||||
destinationPool = storagePool
|
destinationPool = storagePool
|
||||||
break
|
break
|
||||||
|
|
||||||
return destinationPool
|
return destinationPool
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
@ -449,7 +449,7 @@ class StorPoolHelper():
|
||||||
cmd.securitygroupid = id
|
cmd.securitygroupid = id
|
||||||
cmd.account = account
|
cmd.account = account
|
||||||
cmd.domainid = domainid
|
cmd.domainid = domainid
|
||||||
|
|
||||||
apiclient.authorizeSecurityGroupIngress(cmd)
|
apiclient.authorizeSecurityGroupIngress(cmd)
|
||||||
|
|
||||||
cmd.protocol = 'ICMP'
|
cmd.protocol = 'ICMP'
|
||||||
|
|
@ -466,7 +466,7 @@ class StorPoolHelper():
|
||||||
"""
|
"""
|
||||||
This method is to migrate a VM using migrate virtual machine API
|
This method is to migrate a VM using migrate virtual machine API
|
||||||
"""
|
"""
|
||||||
|
|
||||||
vm.migrate(
|
vm.migrate(
|
||||||
apiclient,
|
apiclient,
|
||||||
hostid=destinationHost.id,
|
hostid=destinationHost.id,
|
||||||
|
|
@ -493,7 +493,7 @@ class StorPoolHelper():
|
||||||
4. pools -> list of destination pools
|
4. pools -> list of destination pools
|
||||||
"""
|
"""
|
||||||
vol_pool_map = {vol.id: pool.id for vol in volumes}
|
vol_pool_map = {vol.id: pool.id for vol in volumes}
|
||||||
|
|
||||||
cmd = migrateVirtualMachineWithVolume.migrateVirtualMachineWithVolumeCmd()
|
cmd = migrateVirtualMachineWithVolume.migrateVirtualMachineWithVolumeCmd()
|
||||||
cmd.hostid = destinationHost.id
|
cmd.hostid = destinationHost.id
|
||||||
cmd.migrateto = []
|
cmd.migrateto = []
|
||||||
|
|
@ -514,7 +514,7 @@ class StorPoolHelper():
|
||||||
assert isinstance(migrated_vm_response, list), "Check list virtual machines response for valid list"
|
assert isinstance(migrated_vm_response, list), "Check list virtual machines response for valid list"
|
||||||
|
|
||||||
assert migrated_vm_response[0].hostid == destinationHost.id, "VM did not migrate to a specified host"
|
assert migrated_vm_response[0].hostid == destinationHost.id, "VM did not migrate to a specified host"
|
||||||
|
|
||||||
for vol in volumes:
|
for vol in volumes:
|
||||||
migrated_volume_response = list_volumes(
|
migrated_volume_response = list_volumes(
|
||||||
apiclient,
|
apiclient,
|
||||||
|
|
@ -523,9 +523,9 @@ class StorPoolHelper():
|
||||||
listall=True)
|
listall=True)
|
||||||
assert isinstance(migrated_volume_response, list), "Check list virtual machines response for valid list"
|
assert isinstance(migrated_volume_response, list), "Check list virtual machines response for valid list"
|
||||||
assert migrated_volume_response[0].storageid == pool.id, "Volume did not migrate to a specified pool"
|
assert migrated_volume_response[0].storageid == pool.id, "Volume did not migrate to a specified pool"
|
||||||
|
|
||||||
assert str(migrated_volume_response[0].state).lower().eq('ready'), "Check migrated volume is in Ready state"
|
assert str(migrated_volume_response[0].state).lower().eq('ready'), "Check migrated volume is in Ready state"
|
||||||
|
|
||||||
return migrated_vm_response[0]
|
return migrated_vm_response[0]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
@ -683,7 +683,7 @@ class StorPoolHelper():
|
||||||
cmd.diskofferingid = disk_offering.id
|
cmd.diskofferingid = disk_offering.id
|
||||||
if size:
|
if size:
|
||||||
cmd.size = size
|
cmd.size = size
|
||||||
|
|
||||||
if maxiops:
|
if maxiops:
|
||||||
cmd.maxiops = maxiops
|
cmd.maxiops = maxiops
|
||||||
if miniops:
|
if miniops:
|
||||||
|
|
|
||||||
|
|
@ -322,5 +322,5 @@ class TestVmSnapshot(cloudstackTestCase):
|
||||||
virtualmachineid=self.virtual_machine.id,
|
virtualmachineid=self.virtual_machine.id,
|
||||||
listall=False)
|
listall=False)
|
||||||
self.debug('list_snapshot_response -------------------- %s' % list_snapshot_response)
|
self.debug('list_snapshot_response -------------------- %s' % list_snapshot_response)
|
||||||
|
|
||||||
self.assertIsNone(list_snapshot_response, "snapshot is already deleted")
|
self.assertIsNone(list_snapshot_response, "snapshot is already deleted")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue