From 166eb60dbb57f29ad8f57d2ca4798a2c7db404b2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 6 Jun 2023 07:34:59 +0100 Subject: [PATCH] Stop using `__utils__` in `salt/grains/zfs.py` Refs #62191 Signed-off-by: Pedro Algarvio --- salt/grains/zfs.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/salt/grains/zfs.py b/salt/grains/zfs.py index e903d010832a..ec41dc41192d 100644 --- a/salt/grains/zfs.py +++ b/salt/grains/zfs.py @@ -24,12 +24,6 @@ __salt__ = { "cmd.run": salt.modules.cmdmod.run, } -__utils__ = { - "zfs.is_supported": salt.utils.zfs.is_supported, - "zfs.has_feature_flags": salt.utils.zfs.has_feature_flags, - "zfs.zpool_command": salt.utils.zfs.zpool_command, - "zfs.to_size": salt.utils.zfs.to_size, -} log = logging.getLogger(__name__) @@ -53,7 +47,7 @@ def _zfs_pool_data(): grains = {} # collect zpool data - zpool_list_cmd = __utils__["zfs.zpool_command"]( + zpool_list_cmd = salt.utils.zfs.zpool_command( "list", flags=["-H"], opts={"-o": "name,size"}, @@ -62,7 +56,7 @@ def _zfs_pool_data(): if "zpool" not in grains: grains["zpool"] = {} zpool = zpool.split() - grains["zpool"][zpool[0]] = __utils__["zfs.to_size"](zpool[1], False) + grains["zpool"][zpool[0]] = salt.utils.zfs.to_size(zpool[1], False) # return grain data return grains @@ -73,8 +67,8 @@ def zfs(): Provide grains for zfs/zpool """ grains = {} - grains["zfs_support"] = __utils__["zfs.is_supported"]() - grains["zfs_feature_flags"] = __utils__["zfs.has_feature_flags"]() + grains["zfs_support"] = salt.utils.zfs.is_supported() + grains["zfs_feature_flags"] = salt.utils.zfs.has_feature_flags() if grains["zfs_support"]: grains = salt.utils.dictupdate.update( grains, _zfs_pool_data(), merge_lists=True