Skip to content

Commit ef88a9c

Browse files
committed
Enable retry for eos command
1 parent dde98b7 commit ef88a9c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/common/devices/eos.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import os
66

77
from tests.common.devices.base import AnsibleHostBase
8+
from tests.common.errors import RunAnsibleModuleFail
9+
from retry import retry
810

911
logger = logging.getLogger(__name__)
1012

@@ -92,6 +94,7 @@ def shutdown_multiple(self, interfaces):
9294
intf_str = ','.join(interfaces)
9395
return self.shutdown(intf_str)
9496

97+
@retry(RunAnsibleModuleFail, tries=3, delay=5)
9598
def no_shutdown(self, interface_name):
9699
out = self.eos_config(
97100
lines=['no shutdown'],
@@ -222,18 +225,21 @@ def kill_bgpd(self):
222225
out = self.eos_config(lines=['agent {} shutdown'.format(agent)])
223226
return out
224227

228+
@retry(RunAnsibleModuleFail, tries=3, delay=5)
225229
def start_bgpd(self):
226230
agent = 'Bgp' if self.is_multiagent() else 'Rib'
227231
out = self.eos_config(lines=['no agent {} shutdown'.format(agent)])
228232
return out
229233

234+
@retry(RunAnsibleModuleFail, tries=3, delay=5)
230235
def no_shutdown_bgp(self, asn):
231236
out = self.eos_config(
232237
lines=['no shut'],
233238
parents=['router bgp {}'.format(asn)])
234239
logging.info('No shut BGP [%s]' % asn)
235240
return out
236241

242+
@retry(RunAnsibleModuleFail, tries=3, delay=5)
237243
def no_shutdown_bgp_neighbors(self, asn, neighbors=[]):
238244
if not neighbors:
239245
return

0 commit comments

Comments
 (0)