]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/rook: rename variable from all to _all 55255/head
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 22 Jan 2024 18:37:24 +0000 (13:37 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 24 Jan 2024 18:33:29 +0000 (13:33 -0500)
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 <jmulligan@redhat.com>
src/pybind/mgr/rook/rook_cluster.py

index c7d2a34a7b7553c8834e22166c9af4a1db998b5a..ff8af5f38df482ddb810b289f8d70e53131f9578 100644 (file)
@@ -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)