Skip to content

Commit

Permalink
Merge pull request #224 from stephanerobert/commit_transaction
Browse files Browse the repository at this point in the history
Commit transaction in Arista
  • Loading branch information
stephanerobert committed Oct 25, 2018
2 parents 1a27b29 + 3cb3108 commit 26345c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions netman/adapters/switches/arista.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def _end_transaction(self):
def _start_transaction(self):
pass

def commit_transaction(self):
self.node.enable('write memory')

def get_vlan(self, number):
try:
vlans_result, interfaces_result = self.node.enable(
Expand Down
5 changes: 5 additions & 0 deletions tests/adapters/switches/arista_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,8 @@ def test_remove_ip_from_unknown_vlan(self):

with self.assertRaises(UnknownVlan):
self.switch.remove_ip_from_vlan(123, IPNetwork("1.1.1.1/30"))

def test_transactions_commit_write_memory(self):
self.switch.node.should_receive("enable").with_args("write memory").once()

self.switch.commit_transaction()

0 comments on commit 26345c1

Please sign in to comment.