From a0a6fba7eaf7b04b37edd7e2266a2a73a43c37ee Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Wed, 24 Apr 2024 14:26:21 -0600 Subject: [PATCH] Remove __virtual__ and __hostname__ --- salt/utils/win_lgpo_netsh.py | 17 ----------------- salt/utils/win_pwsh.py | 12 ------------ 2 files changed, 29 deletions(-) diff --git a/salt/utils/win_lgpo_netsh.py b/salt/utils/win_lgpo_netsh.py index 1a0ab75911e..6f54d4e25b7 100644 --- a/salt/utils/win_lgpo_netsh.py +++ b/salt/utils/win_lgpo_netsh.py @@ -74,8 +74,6 @@ store='lgpo') """ -import socket - import salt.utils.platform import salt.utils.win_pwsh from salt.exceptions import CommandExecutionError @@ -106,21 +104,6 @@ "blockoutbound": "Block", } -__virtualname__ = "netsh" -__hostname__ = socket.gethostname() - - -# Although utils are often directly imported, it is also possible to use the -# loader. -def __virtual__(): - """ - Only load if on a Windows system - """ - if not salt.utils.platform.is_windows(): - return False, "This utility only available on Windows" - - return __virtualname__ - def _get_inbound_text(rule, action): """ diff --git a/salt/utils/win_pwsh.py b/salt/utils/win_pwsh.py index 7cf119165fa..ff5fae42968 100644 --- a/salt/utils/win_pwsh.py +++ b/salt/utils/win_pwsh.py @@ -3,18 +3,6 @@ import salt.utils.platform from salt.exceptions import CommandExecutionError -__virtualname__ = "win_pwsh" - - -def __virtual__(): - """ - Only load if windows - """ - if not salt.utils.platform.is_windows(): - return False, "This utility will only run on Windows" - - return __virtualname__ - def run_dict(cmd, cwd=None): """