Skip to content

Commit f70c19e

Browse files
committed
Disable Juniper/Arista SCP; roll version
1 parent 7eff3e2 commit f70c19e

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

netmiko/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
NetmikoTimeoutError = NetMikoTimeoutException
2222
NetmikoAuthError = NetMikoAuthenticationException
2323

24-
__version__ = '1.5.1'
24+
__version__ = '2.0.0'
2525
__all__ = ('ConnectHandler', 'ssh_dispatcher', 'platforms', 'SCPConn', 'FileTransfer',
2626
'NetMikoTimeoutException', 'NetMikoAuthenticationException',
2727
'NetmikoTimeoutError', 'NetmikoAuthError', 'InLineTransfer', 'redispatch',

netmiko/arista/arista_ssh.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def check_config_mode(self, check_string=')#', pattern=''):
3939
class AristaFileTransfer(CiscoFileTransfer):
4040
"""Arista SCP File Transfer driver."""
4141
def __init__(self, ssh_conn, source_file, dest_file, file_system=None, direction='put'):
42+
msg = "Arista SCP Driver is under development and not fully implemented"
43+
raise NotImplementedError(msg)
4244
self.ssh_ctl_chan = ssh_conn
4345
self.source_file = source_file
4446
self.dest_file = dest_file
@@ -47,16 +49,16 @@ def __init__(self, ssh_conn, source_file, dest_file, file_system=None, direction
4749
if file_system:
4850
self.file_system = file_system
4951
else:
50-
raise ValueError("Destination file system must be specified for NX-OS")
52+
raise ValueError("Destination file system must be specified for Arista")
5153

52-
# if direction == 'put':
53-
# self.source_md5 = self.file_md5(source_file)
54-
# self.file_size = os.stat(source_file).st_size
55-
# elif direction == 'get':
56-
# self.source_md5 = self.remote_md5(remote_file=source_file)
57-
# self.file_size = self.remote_file_size(remote_file=source_file)
58-
# else:
59-
# raise ValueError("Invalid direction specified")
54+
# if direction == 'put':
55+
# self.source_md5 = self.file_md5(source_file)
56+
# self.file_size = os.stat(source_file).st_size
57+
# elif direction == 'get':
58+
# self.source_md5 = self.remote_md5(remote_file=source_file)
59+
# self.file_size = self.remote_file_size(remote_file=source_file)
60+
# else:
61+
# raise ValueError("Invalid direction specified")
6062

6163
def put_file(self):
6264
"""SCP copy the file from the local system to the remote device."""
@@ -108,7 +110,6 @@ def remote_file_size(self, remote_cmd="", remote_file=None):
108110

109111
@staticmethod
110112
def process_md5(md5_output, pattern=r"= (.*)"):
111-
"""Not needed on NX-OS."""
112113
raise NotImplementedError
113114

114115
def remote_md5(self, base_cmd='show file', remote_file=None):

netmiko/juniper/juniper_ssh.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ def strip_context_items(self, a_string):
190190
class JuniperFileTransfer(BaseFileTransfer):
191191
"""Juniper SCP File Transfer driver."""
192192
def __init__(self, ssh_conn, source_file, dest_file, file_system="/var/tmp", direction='put'):
193+
msg = "Juniper SCP Driver is under development and not fully implemented"
194+
raise NotImplementedError(msg)
193195
self.ssh_ctl_chan = ssh_conn
194196
self.dest_file = dest_file
195197
self.direction = direction
@@ -198,11 +200,11 @@ def __init__(self, ssh_conn, source_file, dest_file, file_system="/var/tmp", dir
198200

199201
if direction == 'put':
200202
self.source_file = source_file
201-
# self.source_md5 = self.file_md5(source_file)
203+
# self.source_md5 = self.file_md5(source_file)
202204
self.file_size = os.stat(self.source_file).st_size
203205
elif direction == 'get':
204206
self.source_file = "{}/{}".format(file_system, source_file)
205-
# self.source_md5 = self.remote_md5(remote_file=source_file)
207+
# self.source_md5 = self.remote_md5(remote_file=source_file)
206208
self.file_size = self.remote_file_size(remote_file=self.source_file)
207209
else:
208210
raise ValueError("Invalid direction specified")

0 commit comments

Comments
 (0)