Re-enable important py3k checks for gui

Re-enabling some of the disabled tox warnings present on
the pylint.rc file
Re-enabling:

W1619: old-division
W1633: round-builtin
W1637: zip-builtin-not-iterating
W1639: filter-builtin-not-iterating

Note:
W1633: Was suppressed inline and floated to keep the same behavior from
py2
W1619: No change needed. Suppressed inline added.

Test Plan: Sanity test run on AIO-SX:

PASS: test_system_health_pre_session[pods]
PASS: test_system_health_pre_session[alarms]
PASS: test_system_health_pre_session[system_apps]
PASS: test_wr_analytics[deploy_and_remove]
PASS: test_horizon_host_inventory_display
PASS: test_lock_unlock_host[controller]
PASS: test_pod_to_pod_connection
PASS: test_pod_to_service_connection
PASS: test_host_to_service_connection

Story: 2006796
Task: 43381
Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I809adc421a155f5efcc88827b00401477eecb1f3
This commit is contained in:
Bernardo Decco 2021-09-21 11:41:50 -03:00 committed by Bernardo Decco de Siqueira
parent 8a62ff5708
commit 550c0fe2c5
5 changed files with 19 additions and 19 deletions

View File

@ -116,10 +116,6 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
# W0613 Unused argument warning # W0613 Unused argument warning
# W0703 broad except warning # W0703 broad except warning
# W1618: no-absolute-import # W1618: no-absolute-import
# W1619: old-division
# W1633: round-builtin
# W1637: zip-builtin-not-iterating
# W1639: filter-builtin-not-iterating
# E0202 method-hidden # E0202 method-hidden
# E0203 access-member-before-definition # E0203 access-member-before-definition
# E1101 no-member # E1101 no-member
@ -128,8 +124,7 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
# E0401: Unable to import 'django.core.urlresolvers' (import-error) # E0401: Unable to import 'django.core.urlresolvers' (import-error)
# E0611: No name 'urlresolvers' in module 'django.core' (no-name-in-module) # E0611: No name 'urlresolvers' in module 'django.core' (no-name-in-module)
disable=C, R, W0107, W0201, W0212, W0221, W0235, disable=C, R, W0107, W0201, W0212, W0221, W0235,
W0403, W0511, W0613, W0703, W1618, W1619, W0403, W0511, W0613, W0703, W1618,
W1633, W1637, W1639,
E0202, E0203, E1101, E0401, E0611 E0202, E0203, E1101, E0401, E0611
[REPORTS] [REPORTS]

View File

@ -288,11 +288,13 @@ class Disk(base.APIResourceWrapper):
@property @property
def size_gib(self): def size_gib(self):
return math.floor(float(self.size_mib) / 1024 * 1000) / 1000.0 return math.floor(float(self.size_mib) / # pylint: disable=W1619
1024 * 1000) / 1000.0
@property @property
def available_gib(self): def available_gib(self):
return math.floor(float(self.available_mib) / 1024 * 1000) / 1000.0 return math.floor(float(self.available_mib) / # pylint: disable=W1619
1024 * 1000) / 1000.0
class StorageVolume(base.APIResourceWrapper): class StorageVolume(base.APIResourceWrapper):
@ -384,7 +386,8 @@ class Partition(base.APIResourceWrapper):
@property @property
def size_gib(self): def size_gib(self):
return math.floor(float(self.size_mib) / 1024 * 1000) / 1000.0 return math.floor(float(self.size_mib) / # pylint: disable=W1619
1024 * 1000) / 1000.0
def host_disk_partition_list(request, host_id, disk_id=None): def host_disk_partition_list(request, host_id, disk_id=None):
@ -443,12 +446,12 @@ class LocalVolumeGroup(base.APIResourceWrapper):
@property @property
def lvm_vg_size_gib(self): def lvm_vg_size_gib(self):
return math.floor(float( return math.floor(float( # pylint: disable=W1619
self.lvm_vg_size) / (1024 ** 3) * 1000) / 1000.0 self.lvm_vg_size) / (1024 ** 3) * 1000) / 1000.0
@property @property
def lvm_vg_avail_size_gib(self): def lvm_vg_avail_size_gib(self):
return math.floor(float( return math.floor(float( # pylint: disable=W1619
self.lvm_vg_avail_size) / (1024 ** 3) * 1000) / 1000.0 self.lvm_vg_avail_size) / (1024 ** 3) * 1000) / 1000.0

View File

@ -345,9 +345,10 @@ class UpdateMemory(forms.SelfHandlingForm):
vm_2M_field.initial = str(m.vm_hugepages_nr_2M_pending) vm_2M_field.initial = str(m.vm_hugepages_nr_2M_pending)
elif m.vm_hugepages_nr_2M: elif m.vm_hugepages_nr_2M:
if(m.vm_pending_as_percentage == "True"): if(m.vm_pending_as_percentage == "True"):
vm_2M_field.initial = str( vm_2M_field.initial = str(float(
round(m.vm_hugepages_nr_2M * round( # pylint: disable=W1633
100 // m.vm_hugepages_possible_2M)) m.vm_hugepages_nr_2M * 100 \
// m.vm_hugepages_possible_2M)))
else: else:
vm_2M_field.initial = str(m.vm_hugepages_nr_2M) vm_2M_field.initial = str(m.vm_hugepages_nr_2M)
else: else:

View File

@ -605,7 +605,7 @@ class HostsWorkerFilterAction(tables.FilterAction):
return True return True
return False return False
return filter(comp, hosts) return list(filter(comp, hosts))
def get_install_percent(cell): def get_install_percent(cell):
@ -640,7 +640,8 @@ def get_task_or_status(host):
if host.install_state_info and '/' in \ if host.install_state_info and '/' in \
host.install_state_info.rstrip('+'): host.install_state_info.rstrip('+'):
values = (host.install_state_info.rstrip('+')).split('/') values = (host.install_state_info.rstrip('+')).split('/')
percent = (float(values[0]) / float(values[1])) * 100 percent = (float(values[0]) / # pylint: disable=W1619
float(values[1])) * 100
task_or_status += " (%d%%)" % percent task_or_status += " (%d%%)" % percent
elif host.task: elif host.task:
if '-' in host.task: if '-' in host.task:

View File

@ -598,9 +598,9 @@ class InterfacesTab(tabs.TableTab):
i.host_id = host.id i.host_id = host.id
port_data = \ port_data = \
list(map(list, zip(*[(p.get_port_display_name(), list(map(list, list(zip(*[(p.get_port_display_name(),
p.neighbours) for p in host.ports if p.neighbours) for p in host.ports if
i.uuid == p.interface_uuid]))) i.uuid == p.interface_uuid]))))
if port_data: if port_data:
# Default interface # Default interface