Skip to content

Commit

Permalink
Fixed vLan parent transform
Browse files Browse the repository at this point in the history
  • Loading branch information
nitish-ks committed Dec 4, 2024
1 parent fa931b8 commit 33d9143
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/modules/nios_vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ def parent_transform(module):
if module.params['parent']:
parent_obj_vlanview = wapi.get_object('vlanview', {'name': module.params['parent']})
parent_obj_vlanrange = wapi.get_object('vlanrange', {'name': module.params['parent']})
if parent_obj_vlanview and not parent_obj_vlanrange:
parent_ref = parent_obj_vlanview[0]['_ref']
elif not parent_obj_vlanview and parent_obj_vlanrange:
if parent_obj_vlanrange:
parent_ref = parent_obj_vlanrange[0]['_ref']
elif parent_obj_vlanview:
parent_ref = parent_obj_vlanview[0]['_ref']
else:
module.fail_json(msg='VLAN View/Range \'%s\' cannot be found.' % module.params['parent'])
return parent_ref
Expand Down

0 comments on commit 33d9143

Please sign in to comment.