diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/common/utils.py b/sysinv/cgts-client/cgts-client/cgtsclient/common/utils.py index df6c7ceaf0..5993d43d8e 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/common/utils.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/common/utils.py @@ -546,8 +546,8 @@ def find_resource(manager, name_or_id): raise exc.CommandError(msg) -def string_to_bool(arg): - return arg.strip().lower() in ('t', 'true', 'yes', '1') +def string_to_bool(s): + return s.strip().lower() in ('t', 'true', 'yes', '1') def env(*vars, **kwargs): diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/v1/device_label_shell.py b/sysinv/cgts-client/cgts-client/cgtsclient/v1/device_label_shell.py index 8648fa7eef..c68f37c0ef 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/v1/device_label_shell.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/v1/device_label_shell.py @@ -46,9 +46,9 @@ def do_device_label_list(cc, args): setattr(dl, 'devicename', "") setattr(dl, 'hostname', "") else: - pci_device = cc.pci_device.get(dl.pcidevice_uuid) - setattr(dl, 'devicename', getattr(pci_device, 'name')) - host = ihost_utils._find_ihost(cc, getattr(pci_device, 'host_uuid')) + pci_device_name = cc.pci_device.get(dl.pcidevice_uuid) + setattr(dl, 'devicename', getattr(pci_device_name, 'name')) + host = ihost_utils._find_ihost(cc, getattr(pci_device_name, 'host_uuid')) setattr(dl, 'hostname', host.hostname) field_labels = ['hostname', 'PCI device name', 'label key', 'label value'] fields = ['hostname', 'devicename', 'label_key', 'label_value'] diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/v1/idisk.py b/sysinv/cgts-client/cgts-client/cgtsclient/v1/idisk.py index 66cc11f495..957c58c52b 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/v1/idisk.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/v1/idisk.py @@ -63,10 +63,10 @@ def get_disk_display_name(d): return '(' + str(d.uuid)[-8:] + ')' -def _find_disk(cc, ihost, idisk): - if utils.is_uuid_like(idisk): +def _find_disk(cc, ihost, idisk_id): + if utils.is_uuid_like(idisk_id): try: - disk = cc.idisk.get(idisk) + disk = cc.idisk.get(idisk_id) except exc.HTTPNotFound: return None else: @@ -74,7 +74,7 @@ def _find_disk(cc, ihost, idisk): else: disklist = cc.idisk.list(ihost.uuid) for disk in disklist: - if disk.device_node == idisk or disk.device_path == idisk: + if disk.device_node == idisk_id or disk.device_path == idisk_id: return disk else: return None diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/v1/ihost.py b/sysinv/cgts-client/cgts-client/cgtsclient/v1/ihost.py index f378b7ff1d..95c0b8d37a 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/v1/ihost.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/v1/ihost.py @@ -153,18 +153,18 @@ class ihostManager(base.Manager): return self.resource_class(self, body) -def _find_ihost(cc, ihost): - if ihost.isdigit() or utils.is_uuid_like(ihost): +def _find_ihost(cc, ihost_id): + if ihost_id.isdigit() or utils.is_uuid_like(ihost_id): try: - h = cc.ihost.get(ihost) + h = cc.ihost.get(ihost_id) except exc.HTTPNotFound: - raise exc.CommandError('host not found: %s' % ihost) + raise exc.CommandError('host not found: %s' % ihost_id) else: return h else: hostlist = cc.ihost.list() for h in hostlist: - if h.hostname == ihost: + if h.hostname == ihost_id: return h else: - raise exc.CommandError('host not found: %s' % ihost) + raise exc.CommandError('host not found: %s' % ihost_id) diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/v1/ilvg.py b/sysinv/cgts-client/cgts-client/cgtsclient/v1/ilvg.py index 385bc8e27e..6a5842df8f 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/v1/ilvg.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/v1/ilvg.py @@ -54,22 +54,22 @@ class ilvgManager(base.Manager): return self._update(path, patch) -def _find_ilvg(cc, ihost, ilvg): +def _find_ilvg(cc, ihost, ilvg_id): if ilvg.isdigit(): try: - lvg = cc.ilvg.get(ilvg) + lvg = cc.ilvg.get(ilvg_id) except exc.HTTPNotFound: raise exc.CommandError('Local volume group not found by id: %s' - % ilvg) + % ilvg_id) else: return lvg else: lvglist = cc.ilvg.list(ihost.uuid) for lvg in lvglist: - if lvg.lvm_vg_name == ilvg: + if lvg.lvm_vg_name == ilvg_id: return lvg - if lvg.uuid == ilvg: + if lvg.uuid == ilvg_id: return lvg else: raise exc.CommandError('Local volume group not found by name or ' - 'uuid: %s' % ilvg) + 'uuid: %s' % ilvg_id) diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/v1/ipv.py b/sysinv/cgts-client/cgts-client/cgtsclient/v1/ipv.py index ff7049b521..2a6b23a554 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/v1/ipv.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/v1/ipv.py @@ -62,18 +62,18 @@ def _get_disks(cc, ihost, pv): pv.disks = disk_list -def _find_ipv(cc, ihost, ipv): +def _find_ipv(cc, ihost, ipv_id): if ipv.isdigit(): try: - pv = cc.ipv.get(ipv) + pv = cc.ipv.get(ipv_id) except exc.HTTPNotFound: - raise exc.CommandError('physical volume not found: %s' % ipv) + raise exc.CommandError('physical volume not found: %s' % ipv_id) else: return pv else: pvlist = cc.ipv.list(ihost.uuid) for pv in pvlist: - if pv.uuid == ipv: + if pv.uuid == ipv_id: return pv else: - raise exc.CommandError('physical volume not found: %s' % ipv) + raise exc.CommandError('physical volume not found: %s' % ipv_id) diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/v1/isystem.py b/sysinv/cgts-client/cgts-client/cgtsclient/v1/isystem.py index 778a70d2d8..5e8f8f427c 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/v1/isystem.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/v1/isystem.py @@ -55,10 +55,10 @@ class isystemManager(base.Manager): return self._update(self._path(isystem_id), patch) -def _find_isystem(cc, isystem): +def _find_isystem(cc, isystem_id): try: - h = cc.isystem.get(isystem) + h = cc.isystem.get(isystem_id) except exc.HTTPNotFound: - raise exc.CommandError('system not found: %s' % isystem) + raise exc.CommandError('system not found: %s' % isystem_id) else: return h diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/v1/partition.py b/sysinv/cgts-client/cgts-client/cgtsclient/v1/partition.py index 9ed5a54f17..07bed1a412 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/v1/partition.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/v1/partition.py @@ -56,15 +56,15 @@ class partitionManager(base.Manager): return self._update(path, patch) -def _find_partition(cc, ihost, partition, idisk=None): +def _find_partition(cc, ihost, partition_id, idisk=None): if idisk: part_list = cc.partition.list(ihost.uuid, idisk.uuid) else: part_list = cc.partition.list(ihost.uuid) for p in part_list: - if p.device_path == partition: + if p.device_path == partition_id: return p - if p.uuid == partition: + if p.uuid == partition_id: return p else: return None diff --git a/sysinv/cgts-client/cgts-client/pylint.rc b/sysinv/cgts-client/cgts-client/pylint.rc index 63cbe68afd..1840a34a84 100755 --- a/sysinv/cgts-client/cgts-client/pylint.rc +++ b/sysinv/cgts-client/cgts-client/pylint.rc @@ -128,7 +128,6 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652, # W0611: unused-import # W0612: unused-variable # W0613: unused-argument -# W0621: redefined-outer-name # W0622: redefined-builtin # W0631: undefined-loop-variable # W0703: broad-except @@ -136,7 +135,7 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652, # W1618: no-absolute-import disable=C, R, fixme, W0105, W0108, W0110, W0120, W0123, W0201, W0212, W0231, W0235, W0402, W0403, W0603, W0611, - W0612, W0613, W0621, W0622, W0631, W0703, W1401, + W0612, W0613, W0622, W0631, W0703, W1401, W1618 [REPORTS]