Remove netmiko_conn, pyeapi_conn

This commit is contained in:
cmcmarrow 2023-06-12 11:32:17 -05:00 committed by Pedro Algarvio
parent dbea252572
commit ce356f1737
2 changed files with 1 additions and 60 deletions

View file

@ -0,0 +1 @@
Remove netmiko_conn and pyeapi_conn from salt.modules.napalm_mod

View file

@ -742,36 +742,6 @@ def netmiko_config(*config_commands, **kwargs):
return __salt__["netmiko.send_config"](config_commands=config_commands, **kwargs)
@proxy_napalm_wrap
def netmiko_conn(**kwargs):
"""
.. versionadded:: 2019.2.0
Return the connection object with the network device, over Netmiko, passing
the authentication details from the existing NAPALM connection.
.. warning::
This function is not suitable for CLI usage, more rather to be used
in various Salt modules.
USAGE Example:
.. code-block:: python
conn = __salt__['napalm.netmiko_conn']()
res = conn.send_command('show interfaces')
conn.disconnect()
"""
salt.utils.versions.warn_until(
"Chlorine",
"This 'napalm_mod.netmiko_conn' function as been deprecated and "
"will be removed in the {version} release, as such, it has been "
"made an internal function since it is not suitable for CLI usage",
)
return _netmiko_conn(**kwargs)
@proxy_napalm_wrap
def junos_rpc(cmd=None, dest=None, format=None, **kwargs):
"""
@ -1139,36 +1109,6 @@ def pyeapi_call(method, *args, **kwargs):
return __salt__["pyeapi.call"](method, *args, **pyeapi_kwargs)
@proxy_napalm_wrap
def pyeapi_conn(**kwargs):
"""
.. versionadded:: 2019.2.0
Return the connection object with the Arista switch, over ``pyeapi``,
passing the authentication details from the existing NAPALM connection.
.. warning::
This function is not suitable for CLI usage, more rather to be used in
various Salt modules, to reusing the established connection, as in
opposite to opening a new connection for each task.
Usage example:
.. code-block:: python
conn = __salt__['napalm.pyeapi_conn']()
res1 = conn.run_commands('show version')
res2 = conn.get_config(as_string=True)
"""
salt.utils.versions.warn_until(
"Chlorine",
"This 'napalm_mod.pyeapi_conn' function as been deprecated and "
"will be removed in the {version} release, as such, it has been "
"made an internal function since it is not suitable for CLI usage",
)
return _pyeapi_conn(**kwargs)
@proxy_napalm_wrap
def pyeapi_config(
commands=None,