From 21d794dea884f79411c0c62b7ed733dc7cf162ba Mon Sep 17 00:00:00 2001 From: "laura.panzariello" Date: Wed, 2 Dec 2020 17:10:31 -0300 Subject: [PATCH] update dell plugin to allow 0s10 models --- networkapi/plugins/Dell/FTOS/plugin.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/networkapi/plugins/Dell/FTOS/plugin.py b/networkapi/plugins/Dell/FTOS/plugin.py index f8bd5d143..bc3f1cb16 100644 --- a/networkapi/plugins/Dell/FTOS/plugin.py +++ b/networkapi/plugins/Dell/FTOS/plugin.py @@ -39,6 +39,7 @@ class FTOS(BasePlugin): admin_privileges = 15 VALID_TFTP_PUT_MESSAGE = 'bytes successfully copied' + VALID_TFTP_PUT_MESSAGE_OS10 = 'Copy succeeded' def bgp(self): return BGP(equipment=self.equipment) @@ -202,10 +203,17 @@ def waitString(self, wait_str_ok_regex='', wait_str_invalid_regex=None, wait_str raise exceptions.InvalidCommandException(file_name_string) elif re.search(wait_str_ok_regex, output_line): log.debug('Equipment output: %s' % output_line) - # test bug switch copying 0 bytes + if output_line == '0 bytes successfully copied': log.debug('Switch copied 0 bytes, need to try again.') raise exceptions.CurrentlyBusyErrorException() string_ok = 1 + elif re.search(self.VALID_TFTP_PUT_MESSAGE_OS10, output_line): + log.debug('Equipment output: %s' % output_line) + + if output_line == 'Copy failed': + log.debug('Switch copied 0 bytes, need to try again.') + raise exceptions.CurrentlyBusyErrorException() + string_ok = 1 return recv_string