mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #64466 from cmcmarrow/remove_conn_func_from_napalm
[master] Remove salt.modules.napalm_mod.netmiko_conn and pyeapi_conn
This commit is contained in:
commit
0892d07684
2 changed files with 6 additions and 61 deletions
1
changelog/64460.removed.md
Normal file
1
changelog/64460.removed.md
Normal file
|
@ -0,0 +1 @@
|
|||
Remove netmiko_conn and pyeapi_conn from salt.modules.napalm_mod
|
|
@ -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(
|
||||
3007,
|
||||
"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(
|
||||
3007,
|
||||
"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,
|
||||
|
@ -1839,7 +1779,11 @@ def config_diff_text(
|
|||
|
||||
@depends(HAS_SCP)
|
||||
def scp_get(
|
||||
remote_path, local_path="", recursive=False, preserve_times=False, **kwargs
|
||||
remote_path,
|
||||
local_path="",
|
||||
recursive=False,
|
||||
preserve_times=False,
|
||||
**kwargs,
|
||||
):
|
||||
"""
|
||||
.. versionadded:: 2019.2.0
|
||||
|
|
Loading…
Add table
Reference in a new issue