Skip to content

Commit

Permalink
Allow setting of bpdu_filter, tags and cli_append_str via interfaces API
Browse files Browse the repository at this point in the history
  • Loading branch information
indy-independence committed Oct 22, 2021
1 parent fcf8987 commit bc154db
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/cnaas_nms/api/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,26 @@ def put(self, hostname):
errors.append(
"Aggregate ID must be an integer: {}".
format(if_dict['data']['aggregate_id']))
if 'bpdu_filter' in if_dict['data']:
if type(if_dict['data']['bpdu_filter']) == bool:
intfdata['bpdu_filter'] = if_dict['data']['bpdu_filter']
else:
errors.append(
"bpdu_filter must be a bool, true or false, got: {}".
format(if_dict['data']['bpdu_filter']))
if 'tags' in if_dict['data']:
if isinstance(if_dict['data']['tags'], list):
intfdata['tags'] = if_dict['data']['tags']
else:
errors.append("tags should be of type list, found {}".format(
type(if_dict['data']['tags'])
))
if 'cli_append_str' in if_dict['data']:
if isinstance(if_dict['data']['cli_append_str'], str):
intfdata['cli_append_str'] = if_dict['data']['cli_append_str']
else:
errors.append("cli_append_str must be a string, got: {}".format(
if_dict['data']['cli_append_str']))

if intfdata != intfdata_original:
intf.data = intfdata
Expand Down

0 comments on commit bc154db

Please sign in to comment.