|
5 | 5 | import os |
6 | 6 |
|
7 | 7 | from tests.common.devices.base import AnsibleHostBase |
| 8 | +from tests.common.errors import RunAnsibleModuleFail |
| 9 | +from retry import retry |
8 | 10 |
|
9 | 11 | logger = logging.getLogger(__name__) |
10 | 12 |
|
@@ -92,6 +94,7 @@ def shutdown_multiple(self, interfaces): |
92 | 94 | intf_str = ','.join(interfaces) |
93 | 95 | return self.shutdown(intf_str) |
94 | 96 |
|
| 97 | + @retry(RunAnsibleModuleFail, tries=3, delay=5) |
95 | 98 | def no_shutdown(self, interface_name): |
96 | 99 | out = self.eos_config( |
97 | 100 | lines=['no shutdown'], |
@@ -222,18 +225,21 @@ def kill_bgpd(self): |
222 | 225 | out = self.eos_config(lines=['agent {} shutdown'.format(agent)]) |
223 | 226 | return out |
224 | 227 |
|
| 228 | + @retry(RunAnsibleModuleFail, tries=3, delay=5) |
225 | 229 | def start_bgpd(self): |
226 | 230 | agent = 'Bgp' if self.is_multiagent() else 'Rib' |
227 | 231 | out = self.eos_config(lines=['no agent {} shutdown'.format(agent)]) |
228 | 232 | return out |
229 | 233 |
|
| 234 | + @retry(RunAnsibleModuleFail, tries=3, delay=5) |
230 | 235 | def no_shutdown_bgp(self, asn): |
231 | 236 | out = self.eos_config( |
232 | 237 | lines=['no shut'], |
233 | 238 | parents=['router bgp {}'.format(asn)]) |
234 | 239 | logging.info('No shut BGP [%s]' % asn) |
235 | 240 | return out |
236 | 241 |
|
| 242 | + @retry(RunAnsibleModuleFail, tries=3, delay=5) |
237 | 243 | def no_shutdown_bgp_neighbors(self, asn, neighbors=[]): |
238 | 244 | if not neighbors: |
239 | 245 | return |
|
0 commit comments