Skip to content

Commit

Permalink
ndb.objects.interface: return self in add/del_altname
Browse files Browse the repository at this point in the history
  • Loading branch information
svinota committed Feb 21, 2024
1 parent e87c145 commit 228b3b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyroute2/ndb/objects/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,14 @@ def add_altname(self, ifname):
new_list = set(self['alt_ifname_list'])
new_list.add(ifname)
self['alt_ifname_list'] = list(new_list)
return self

@check_auth('obj:modify')
def del_altname(self, ifname):
new_list = set(self['alt_ifname_list'])
new_list.remove(ifname)
self['alt_ifname_list'] = list(new_list)
return self

@check_auth('obj:modify')
def __setitem__(self, key, value):
Expand Down

0 comments on commit 228b3b2

Please sign in to comment.