PR to fix the issue of keyerror in Nios api (#49183)
* ipv4addr keyerror fix Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com> * fix review comment Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
This commit is contained in:
parent
3784abc96a
commit
40a806d156
1 changed files with 2 additions and 1 deletions
|
@ -230,7 +230,8 @@ class WapiModule(WapiBase):
|
|||
if ib_obj_ref:
|
||||
if len(ib_obj_ref) > 1:
|
||||
for each in ib_obj_ref:
|
||||
if each['ipv4addr'] == proposed_object['ipv4addr']:
|
||||
if ('ipv4addr' in each) and ('ipv4addr' in proposed_object)\
|
||||
and each['ipv4addr'] == proposed_object['ipv4addr']:
|
||||
current_object = each
|
||||
else:
|
||||
current_object = ib_obj_ref[0]
|
||||
|
|
Loading…
Reference in a new issue