From: John Mulligan Date: Mon, 22 Jan 2024 18:37:24 +0000 (-0500) Subject: pybind/mgr/rook: rename variable from all to _all X-Git-Tag: v19.3.0~130^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a450820b474338e5f5ac19c593c73f5d2aa08557;p=ceph.git pybind/mgr/rook: rename variable from all to _all Every time I looked at these functions my brain would be thrown off by `all or ...` as I see all as the builtin function `all`: https://docs.python.org/3/library/functions.html#all Rename `all` so that it avoids shadowing the function `all` and avoid some confusion for people like me. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index c7d2a34a7b75..ff8af5f38df4 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -425,7 +425,7 @@ class DefaultCreator(): sizematcher = SizeMatcher('size', drive_group.data_devices.size) limit = getattr(drive_group.data_devices, 'limit', None) count = 0 - all = getattr(drive_group.data_devices, 'all', None) + _all = getattr(drive_group.data_devices, 'all', None) paths = [device.path for device in drive_group.data_devices.paths] osd_list = [] for pod in rook_pods.items: @@ -445,7 +445,7 @@ class DefaultCreator(): if not limit or (count < limit): if device.available: if ( - all + _all or ( device.sys_api['node'] in matching_hosts and sizematcher.compare(device) @@ -489,7 +489,7 @@ class LSOCreator(DefaultCreator): if drive_group.data_devices.size: sizematcher = SizeMatcher('size', drive_group.data_devices.size) limit = getattr(drive_group.data_devices, 'limit', None) - all = getattr(drive_group.data_devices, 'all', None) + _all = getattr(drive_group.data_devices, 'all', None) paths = [device.path for device in drive_group.data_devices.paths] vendor = getattr(drive_group.data_devices, 'vendor', None) model = getattr(drive_group.data_devices, 'model', None) @@ -512,7 +512,7 @@ class LSOCreator(DefaultCreator): if not limit or (count < limit): if device.available: if ( - all + _all or ( device.sys_api['node'] in matching_hosts and sizematcher.compare(device)