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>pull/4420/head
parent
3784abc96a
commit
40a806d156
|
@ -230,7 +230,8 @@ class WapiModule(WapiBase):
|
||||||
if ib_obj_ref:
|
if ib_obj_ref:
|
||||||
if len(ib_obj_ref) > 1:
|
if len(ib_obj_ref) > 1:
|
||||||
for each in ib_obj_ref:
|
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
|
current_object = each
|
||||||
else:
|
else:
|
||||||
current_object = ib_obj_ref[0]
|
current_object = ib_obj_ref[0]
|
||||||
|
|
Loading…
Reference in New Issue