diff --git a/pylint.rc b/pylint.rc index acc89fa3..8fd6acf5 100755 --- a/pylint.rc +++ b/pylint.rc @@ -116,10 +116,6 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652, # W0613 Unused argument warning # W0703 broad except warning # W1618: no-absolute-import -# W1619: old-division -# W1633: round-builtin -# W1637: zip-builtin-not-iterating -# W1639: filter-builtin-not-iterating # E0202 method-hidden # E0203 access-member-before-definition # 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) # E0611: No name 'urlresolvers' in module 'django.core' (no-name-in-module) disable=C, R, W0107, W0201, W0212, W0221, W0235, - W0403, W0511, W0613, W0703, W1618, W1619, - W1633, W1637, W1639, + W0403, W0511, W0613, W0703, W1618, E0202, E0203, E1101, E0401, E0611 [REPORTS] diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/api/sysinv.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/api/sysinv.py index 60bdfa0f..758c0970 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/api/sysinv.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/api/sysinv.py @@ -288,11 +288,13 @@ class Disk(base.APIResourceWrapper): @property 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 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): @@ -384,7 +386,8 @@ class Partition(base.APIResourceWrapper): @property 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): @@ -443,12 +446,12 @@ class LocalVolumeGroup(base.APIResourceWrapper): @property 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 @property 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 diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/memories/forms.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/memories/forms.py index 84308752..6edf905a 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/memories/forms.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/memories/forms.py @@ -345,9 +345,10 @@ class UpdateMemory(forms.SelfHandlingForm): vm_2M_field.initial = str(m.vm_hugepages_nr_2M_pending) elif m.vm_hugepages_nr_2M: if(m.vm_pending_as_percentage == "True"): - vm_2M_field.initial = str( - round(m.vm_hugepages_nr_2M * - 100 // m.vm_hugepages_possible_2M)) + vm_2M_field.initial = str(float( + round( # pylint: disable=W1633 + m.vm_hugepages_nr_2M * 100 \ + // m.vm_hugepages_possible_2M))) else: vm_2M_field.initial = str(m.vm_hugepages_nr_2M) else: diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tables.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tables.py index 96853c98..589ea069 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tables.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tables.py @@ -605,7 +605,7 @@ class HostsWorkerFilterAction(tables.FilterAction): return True return False - return filter(comp, hosts) + return list(filter(comp, hosts)) def get_install_percent(cell): @@ -640,7 +640,8 @@ def get_task_or_status(host): if host.install_state_info and '/' in \ host.install_state_info.rstrip('+'): 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 elif host.task: if '-' in host.task: diff --git a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tabs.py b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tabs.py index a56d53ff..8662dde7 100644 --- a/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tabs.py +++ b/starlingx-dashboard/starlingx-dashboard/starlingx_dashboard/dashboards/admin/inventory/tabs.py @@ -598,9 +598,9 @@ class InterfacesTab(tabs.TableTab): i.host_id = host.id port_data = \ - list(map(list, zip(*[(p.get_port_display_name(), - p.neighbours) for p in host.ports if - i.uuid == p.interface_uuid]))) + list(map(list, list(zip(*[(p.get_port_display_name(), + p.neighbours) for p in host.ports if + i.uuid == p.interface_uuid])))) if port_data: # Default interface