Skip to content

Commit 47c7c77

Browse files
author
igor-feoktistov
committed
Better handler of InfobloxNoIPavailableException
1 parent 5762b75 commit 47c7c77

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

infoblox.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ def get_next_available_ip(self, network):
9292
return ip_v4
9393
else:
9494
if 'text' in r_json:
95-
raise InfobloxNoIPavailableException(r_json['text'])
95+
if 'code' in r_json and r_json['code'] == 'Client.Ibap.Data':
96+
raise InfobloxNoIPavailableException(r_json['text'])
97+
else:
98+
raise InfobloxGeneralException(r_json['text'])
9699
else:
97100
r.raise_for_status()
98101
else:

0 commit comments

Comments
 (0)