Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions tests/common/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,19 +373,15 @@ def shutdown(self, interface_name):
out = self.host.eos_config(
lines=['shutdown'],
parents='interface %s' % interface_name)
if not self.check_intf_link_state(interface_name):
logging.info('Shut interface [%s]' % interface_name)
return out
raise RunAnsibleModuleFail("The interface state is Up but expect Down, detail output: %s" % out[self.hostname])
logging.info('Shut interface [%s]' % interface_name)
return out

def no_shutdown(self, interface_name):
out = self.host.eos_config(
lines=['no shutdown'],
parents='interface %s' % interface_name)
if self.check_intf_link_state(interface_name):
logging.info('No shut interface [%s]' % interface_name)
return out
raise RunAnsibleModuleFail("The interface state is Down but expect Up, detail output: %s" % out[self.hostname])
logging.info('No shut interface [%s]' % interface_name)
return out

def check_intf_link_state(self, interface_name):
show_int_result = self.host.eos_command(
Expand Down