mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
add deprecation warnings in salt/utils/zeromq.py:ip_bracket
This commit is contained in:
parent
1163ef6bb2
commit
d22291d7e9
2 changed files with 20 additions and 2 deletions
1
changelog/62009.deprecated
Normal file
1
changelog/62009.deprecated
Normal file
|
@ -0,0 +1 @@
|
||||||
|
The 'ip_bracket' function has been moved from salt/utils/zeromq.py in salt/utils/network.py
|
|
@ -4,7 +4,9 @@ ZMQ-specific functions
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import salt.utils.versions
|
||||||
from salt.exceptions import SaltSystemExit
|
from salt.exceptions import SaltSystemExit
|
||||||
|
from salt.utils.network import ip_bracket as _new_ip_bracket
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -27,8 +29,11 @@ except Exception: # pylint: disable=broad-except
|
||||||
|
|
||||||
|
|
||||||
def check_ipc_path_max_len(uri):
|
def check_ipc_path_max_len(uri):
|
||||||
# The socket path is limited to 107 characters on Solaris and
|
"""
|
||||||
# Linux, and 103 characters on BSD-based systems.
|
The socket path is limited to 107 characters on Solaris and
|
||||||
|
Linux, and 103 characters on BSD-based systems.
|
||||||
|
"""
|
||||||
|
|
||||||
if zmq is None:
|
if zmq is None:
|
||||||
return
|
return
|
||||||
ipc_path_max_len = getattr(zmq, "IPC_PATH_MAX_LEN", 103)
|
ipc_path_max_len = getattr(zmq, "IPC_PATH_MAX_LEN", 103)
|
||||||
|
@ -40,3 +45,15 @@ def check_ipc_path_max_len(uri):
|
||||||
"path or switch to TCP; in the configuration file, "
|
"path or switch to TCP; in the configuration file, "
|
||||||
'set "ipc_mode: tcp".'.format(uri, ipc_path_max_len)
|
'set "ipc_mode: tcp".'.format(uri, ipc_path_max_len)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def ip_bracket(addr):
|
||||||
|
"This function has been moved to salt.utils.network.ip_bracket"
|
||||||
|
|
||||||
|
salt.utils.versions.warn_until(
|
||||||
|
"Argon",
|
||||||
|
"The 'utils.zeromq.ip_bracket' has been moved to 'utils.network.ip_bracket'. "
|
||||||
|
"Please use 'utils.network.ip_bracket' because 'utils.zeromq.ip_bracket' "
|
||||||
|
"will be removed in future releases.",
|
||||||
|
)
|
||||||
|
return _new_ip_bracket(addr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue