Remove __virtual__ and __hostname__

This commit is contained in:
Shane Lee 2024-04-24 14:26:21 -06:00 committed by Pedro Algarvio
parent 344a3d8c2f
commit 974dacc5bb
2 changed files with 0 additions and 29 deletions

View file

@ -74,8 +74,6 @@ Usage:
store='lgpo')
"""
import socket
import salt.utils.platform
import salt.utils.win_pwsh
from salt.exceptions import CommandExecutionError
@ -106,21 +104,6 @@ OUTBOUND = {
"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):
"""

View file

@ -3,18 +3,6 @@ import salt.utils.json
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):
"""