@@ -105,7 +105,9 @@ def get_next_available_ip(self, network):
105
105
raise InfobloxGeneralException (r_json ['text' ])
106
106
else :
107
107
r .raise_for_status ()
108
- except Exception as e :
108
+ except ValueError :
109
+ raise Exception (r )
110
+ except Exception :
109
111
raise
110
112
111
113
def create_host_record (self , ip_v4 , fqdn ):
@@ -125,7 +127,9 @@ def create_host_record(self, ip_v4, fqdn):
125
127
raise InfobloxGeneralException (r_json ['text' ])
126
128
else :
127
129
r .raise_for_status ()
128
- except Exception as e :
130
+ except ValueError :
131
+ raise Exception (r )
132
+ except Exception :
129
133
raise
130
134
131
135
def delete_host_record (self , fqdn ):
@@ -158,7 +162,9 @@ def delete_host_record(self, fqdn):
158
162
raise InfobloxGeneralException (r_json ['text' ])
159
163
else :
160
164
r .raise_for_status ()
161
- except Exception as e :
165
+ except ValueError :
166
+ raise Exception (r )
167
+ except Exception :
162
168
raise
163
169
164
170
def add_host_alias (self , host_fqdn , alias_fqdn ):
@@ -198,7 +204,9 @@ def add_host_alias(self, host_fqdn, alias_fqdn):
198
204
raise InfobloxGeneralException (r_json ['text' ])
199
205
else :
200
206
r .raise_for_status ()
201
- except Exception as e :
207
+ except ValueError :
208
+ raise Exception (r )
209
+ except Exception :
202
210
raise
203
211
204
212
def delete_host_alias (self , host_fqdn , alias_fqdn ):
@@ -238,7 +246,9 @@ def delete_host_alias(self, host_fqdn, alias_fqdn):
238
246
raise InfobloxGeneralException (r_json ['text' ])
239
247
else :
240
248
r .raise_for_status ()
241
- except Exception as e :
249
+ except ValueError :
250
+ raise Exception (r )
251
+ except Exception :
242
252
raise
243
253
244
254
def create_cname_record (self , canonical , name ):
@@ -258,7 +268,9 @@ def create_cname_record(self, canonical, name):
258
268
raise InfobloxGeneralException (r_json ['text' ])
259
269
else :
260
270
r .raise_for_status ()
261
- except Exception as e :
271
+ except ValueError :
272
+ raise Exception (r )
273
+ except Exception :
262
274
raise
263
275
264
276
def delete_cname_record (self , fqdn ):
@@ -291,7 +303,9 @@ def delete_cname_record(self, fqdn):
291
303
raise InfobloxGeneralException (r_json ['text' ])
292
304
else :
293
305
r .raise_for_status ()
294
- except Exception as e :
306
+ except ValueError :
307
+ raise Exception (r )
308
+ except Exception :
295
309
raise
296
310
297
311
def create_dhcp_range (self , start_ip_v4 , end_ip_v4 ):
@@ -311,7 +325,9 @@ def create_dhcp_range(self, start_ip_v4, end_ip_v4):
311
325
raise InfobloxGeneralException (r_json ['text' ])
312
326
else :
313
327
r .raise_for_status ()
314
- except Exception as e :
328
+ except ValueError :
329
+ raise Exception (r )
330
+ except Exception :
315
331
raise
316
332
317
333
def delete_dhcp_range (self , start_ip_v4 , end_ip_v4 ):
@@ -345,7 +361,9 @@ def delete_dhcp_range(self, start_ip_v4, end_ip_v4):
345
361
raise InfobloxGeneralException (r_json ['text' ])
346
362
else :
347
363
r .raise_for_status ()
348
- except Exception as e :
364
+ except ValueError :
365
+ raise Exception (r )
366
+ except Exception :
349
367
raise
350
368
351
369
def get_host (self , fqdn , fields = None ):
@@ -371,7 +389,9 @@ def get_host(self, fqdn, fields=None):
371
389
raise InfobloxNotFoundException (r_json ['text' ])
372
390
else :
373
391
r .raise_for_status ()
374
- except Exception as e :
392
+ except ValueError :
393
+ raise Exception (r )
394
+ except Exception :
375
395
raise
376
396
377
397
def get_host_by_ip (self , ip_v4 ):
@@ -396,7 +416,9 @@ def get_host_by_ip(self, ip_v4):
396
416
raise InfobloxGeneralException (r_json ['text' ])
397
417
else :
398
418
r .raise_for_status ()
399
- except Exception as e :
419
+ except ValueError :
420
+ raise Exception (r )
421
+ except Exception :
400
422
raise
401
423
402
424
def get_ip_by_host (self , fqdn ):
@@ -424,7 +446,9 @@ def get_ip_by_host(self, fqdn):
424
446
raise InfobloxGeneralException (r_json ['text' ])
425
447
else :
426
448
r .raise_for_status ()
427
- except Exception as e :
449
+ except ValueError :
450
+ raise Exception (r )
451
+ except Exception :
428
452
raise
429
453
430
454
def get_host_extattrs (self , fqdn , attributes = None ):
@@ -456,7 +480,9 @@ def get_host_extattrs(self, fqdn, attributes=None):
456
480
raise InfobloxNotFoundException (r_json ['text' ])
457
481
else :
458
482
r .raise_for_status ()
459
- except Exception as e :
483
+ except ValueError :
484
+ raise Exception (r )
485
+ except Exception :
460
486
raise
461
487
462
488
def get_network (self , network , fields = None ):
@@ -482,7 +508,9 @@ def get_network(self, network, fields=None):
482
508
raise InfobloxNotFoundException (r_json ['text' ])
483
509
else :
484
510
r .raise_for_status ()
485
- except Exception as e :
511
+ except ValueError :
512
+ raise Exception (r )
513
+ except Exception :
486
514
raise
487
515
488
516
def get_network_by_ip (self , ip_v4 ):
@@ -507,7 +535,9 @@ def get_network_by_ip(self, ip_v4):
507
535
raise InfobloxNotFoundException (r_json ['text' ])
508
536
else :
509
537
r .raise_for_status ()
510
- except Exception as e :
538
+ except ValueError :
539
+ raise Exception (r )
540
+ except Exception :
511
541
raise
512
542
513
543
def get_network_by_extattrs (self , attributes ):
@@ -539,7 +569,9 @@ def get_network_by_extattrs(self, attributes):
539
569
raise InfobloxGeneralException (r_json ['text' ])
540
570
else :
541
571
r .raise_for_status ()
542
- except Exception as e :
572
+ except ValueError :
573
+ raise Exception (r )
574
+ except Exception :
543
575
raise
544
576
545
577
def get_host_by_extattrs (self , attributes ):
@@ -571,7 +603,9 @@ def get_host_by_extattrs(self, attributes):
571
603
raise InfobloxNotFoundException (r_json ['text' ])
572
604
else :
573
605
r .raise_for_status ()
574
- except Exception as e :
606
+ except ValueError :
607
+ raise Exception (r )
608
+ except Exception :
575
609
raise
576
610
577
611
def get_network_extattrs (self , network , attributes = None ):
@@ -603,7 +637,9 @@ def get_network_extattrs(self, network, attributes=None):
603
637
raise InfobloxNotFoundException (r_json ['text' ])
604
638
else :
605
639
r .raise_for_status ()
606
- except Exception as e :
640
+ except ValueError :
641
+ raise Exception (r )
642
+ except Exception :
607
643
raise
608
644
609
645
def update_network_extattrs (self , network , attributes ):
@@ -642,7 +678,9 @@ def update_network_extattrs(self, network, attributes):
642
678
raise InfobloxGeneralException (r_json ['text' ])
643
679
else :
644
680
r .raise_for_status ()
645
- except Exception as e :
681
+ except ValueError :
682
+ raise Exception (r )
683
+ except Exception :
646
684
raise
647
685
648
686
def delete_network_extattrs (self , network , attributes ):
@@ -681,7 +719,9 @@ def delete_network_extattrs(self, network, attributes):
681
719
raise InfobloxGeneralException (r_json ['text' ])
682
720
else :
683
721
r .raise_for_status ()
684
- except Exception as e :
722
+ except ValueError :
723
+ raise Exception (r )
724
+ except Exception :
685
725
raise
686
726
687
727
def create_network (self , network ):
@@ -700,7 +740,9 @@ def create_network(self, network):
700
740
raise InfobloxGeneralException (r_json ['text' ])
701
741
else :
702
742
r .raise_for_status ()
703
- except Exception as e :
743
+ except ValueError :
744
+ raise Exception (r )
745
+ except Exception :
704
746
raise
705
747
706
748
def delete_network (self , network ):
@@ -733,7 +775,9 @@ def delete_network(self, network):
733
775
raise InfobloxGeneralException (r_json ['text' ])
734
776
else :
735
777
r .raise_for_status ()
736
- except Exception as e :
778
+ except ValueError :
779
+ raise Exception (r )
780
+ except Exception :
737
781
raise
738
782
739
783
def create_networkcontainer (self , networkcontainer ):
@@ -752,7 +796,9 @@ def create_networkcontainer(self, networkcontainer):
752
796
raise InfobloxGeneralException (r_json ['text' ])
753
797
else :
754
798
r .raise_for_status ()
755
- except Exception as e :
799
+ except ValueError :
800
+ raise Exception (r )
801
+ except Exception :
756
802
raise
757
803
758
804
def delete_networkcontainer (self , networkcontainer ):
@@ -785,5 +831,7 @@ def delete_networkcontainer(self, networkcontainer):
785
831
raise InfobloxGeneralException (r_json ['text' ])
786
832
else :
787
833
r .raise_for_status ()
788
- except Exception as e :
834
+ except ValueError :
835
+ raise Exception (r )
836
+ except Exception :
789
837
raise
0 commit comments