From 4d2e79417bd40cc461957ba5334def16e157f4fd Mon Sep 17 00:00:00 2001 From: "laura.panzariello" Date: Wed, 2 Dec 2020 17:05:32 -0300 Subject: [PATCH 1/2] update error message --- networkapi/requisicaovips/models.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/networkapi/requisicaovips/models.py b/networkapi/requisicaovips/models.py index f93f39c02..8d2ea63c9 100644 --- a/networkapi/requisicaovips/models.py +++ b/networkapi/requisicaovips/models.py @@ -2553,8 +2553,10 @@ def validate_v3(self, pool, permit_created=False): # Ip not found environment if not amb: raise pool_exceptions.IpNotFoundByEnvironment( - 'Environment of IP:%s(%s) and different of ' - 'environment of server pool: %s' % + 'Environment of IP %s(%s) is different of ' + 'environment of server pool %s. ' + 'Look the association of network of IP with ' + 'pool environment.' % (member['ip']['ip_formated'], member['ip']['id'], pool['identifier']) ) @@ -2567,8 +2569,10 @@ def validate_v3(self, pool, permit_created=False): # Ip not found environment if not amb: raise pool_exceptions.IpNotFoundByEnvironment( - 'Environment of IP:%s(%s) and different of ' - 'environment of server pool: %s' % + 'Environment of IP %s(%s) is different of ' + 'environment of server pool %s. ' + 'Look the association of network of IP with ' + 'pool environment.' % (member['ipv6']['ip_formated'], member['ipv6']['id'], pool['identifier']) ) From 21d794dea884f79411c0c62b7ed733dc7cf162ba Mon Sep 17 00:00:00 2001 From: "laura.panzariello" Date: Wed, 2 Dec 2020 17:10:31 -0300 Subject: [PATCH 2/2] 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