Skip to content

Commit

Permalink
Stop using __utils__ in salt/grains/zfs.py
Browse files Browse the repository at this point in the history
Refs #62191

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Jun 6, 2023
1 parent 8dfc923 commit a7f30d5
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions salt/grains/zfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand All @@ -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"},
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a7f30d5

Please sign in to comment.