@@ -18,7 +18,7 @@ def perform_login(username, password, domainName, domainType, base_url):
1818 resp = requests .post (url , headers = headers , json = req_body , verify = False )
1919
2020 if resp .status_code != 201 :
21- raise Exception ('Login API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
21+ print ('Login API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
2222
2323 print ("\n The response code of the Login API: {}\n " .format (resp .status_code ))
2424
@@ -51,7 +51,7 @@ def post_netbackup_VMwarePolicy_defaults(jwt, base_url):
5151 resp = requests .post (url , headers = headers , json = req_body , verify = False )
5252
5353 if resp .status_code != 204 :
54- raise Exception ('Create Policy API with defaults failed with status code {} and {}' .format (resp .status_code , resp .json ()))
54+ print ('Create Policy API with defaults failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
5555
5656 print ("\n {} with defaults is created with status code : {}\n " .format (testVMwarePolicyName ,resp .status_code ))
5757
@@ -77,12 +77,12 @@ def post_netbackup_OraclePolicy_defaults(jwt, base_url):
7777 }
7878 headers = {'Content-Type' : content_type , 'Authorization' : jwt }
7979
80- print ("\n Making POST Request to create VMware Policy with defaults \n " )
80+ print ("\n Making POST Request to create Oracle Policy with defaults \n " )
8181
8282 resp = requests .post (url , headers = headers , json = req_body , verify = False )
8383
8484 if resp .status_code != 204 :
85- raise Exception ('Create Policy API with defaults failed with status code {} and {}' .format (resp .status_code , resp .json ()))
85+ print ('Create Policy API with defaults failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
8686
8787 print ("\n {} with defaults is created with status code : {}\n " .format (testVMwarePolicyName ,resp .status_code ))
8888
@@ -222,7 +222,7 @@ def post_netbackup_VMwarePolicy(jwt, base_url):
222222 resp = requests .post (url , headers = headers , json = req_body , verify = False )
223223
224224 if resp .status_code != 204 :
225- raise Exception ('Create Policy API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
225+ print ('Create Policy API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
226226
227227 print ("\n {} with out defaults is created with status code : {}\n " .format (testVMwarePolicyName ,resp .status_code ))
228228
@@ -235,7 +235,7 @@ def get_netbackup_policies(jwt, base_url):
235235 resp = requests .get (url , headers = headers , verify = False )
236236
237237 if resp .status_code != 200 :
238- raise Exception ('List Policies API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
238+ print ('List Policies API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
239239
240240 print ("\n List policy succeeded with status code: {}\n " .format (resp .status_code ))
241241 print ("\n Json Response body for List policies : \n {}\n " .format (json .loads (resp .content )))
@@ -251,7 +251,7 @@ def get_netbackup_policy(jwt, base_url):
251251 resp = requests .get (url , headers = headers , verify = False )
252252
253253 if resp .status_code != 200 :
254- raise Exception ('GET Policy API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
254+ print ('GET Policy API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
255255
256256 print ("\n Get policy details on {} succeeded with status code: {}\n " .format (testVMwarePolicyName , resp .status_code ))
257257 print ("\n The E-tag for the get policy : {}\n " .format (resp .headers ['ETag' ]))
@@ -268,7 +268,7 @@ def delete_VMware_netbackup_policy(jwt, base_url):
268268 resp = requests .delete (url , headers = headers , verify = False )
269269
270270 if resp .status_code != 204 :
271- raise Exception ('DELETE Policy API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
271+ print ('DELETE Policy API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
272272
273273 print ("\n The policy is deleted with status code: {}\n " .format (resp .status_code ))
274274
@@ -281,7 +281,7 @@ def delete_Oracle_netbackup_policy(jwt, base_url):
281281 resp = requests .delete (url , headers = headers , verify = False )
282282
283283 if resp .status_code != 204 :
284- raise Exception ('DELETE Policy API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
284+ print ('DELETE Policy API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
285285
286286 print ("\n The policy is deleted with status code: {}\n " .format (resp .status_code ))
287287
@@ -315,7 +315,7 @@ def put_netbackup_policy(jwt, base_url):
315315 resp = requests .put (url , headers = headers , json = req_body , verify = False )
316316
317317 if resp .status_code != 204 :
318- raise Exception ('PUT Policy API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
318+ print ('PUT Policy API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
319319 etag = resp .headers ['ETag' ]
320320 print ("\n {} Updated with status code : {}\n " .format (testVMwarePolicyName , resp .status_code ))
321321
@@ -339,7 +339,7 @@ def put_netbackup_client(jwt, base_url):
339339 resp = requests .put (url , headers = headers , json = req_body , verify = False )
340340
341341 if resp .status_code != 201 :
342- raise Exception ('PUT Client API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
342+ print ('PUT Client API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
343343 etag = resp .headers ['ETag' ]
344344 print ("\n {} is added to {} with status code : {}\n " .format (testClientName , testVMwarePolicyName , resp .status_code ))
345345
@@ -353,7 +353,7 @@ def delete_netbackup_client(jwt, base_url):
353353 resp = requests .delete (url , headers = headers , verify = False )
354354
355355 if resp .status_code != 204 :
356- raise Exception ('DELETE Client API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
356+ print ('DELETE Client API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
357357 etag = resp .headers ['ETag' ]
358358 print ("\n Client {} is deleted from {} with status code: {}\n " .format (testClientName , testVMwarePolicyName , resp .status_code ))
359359
@@ -367,7 +367,7 @@ def delete_netbackup_schedule(jwt, base_url):
367367 resp = requests .delete (url , headers = headers , verify = False )
368368
369369 if resp .status_code != 204 :
370- raise Exception ('DELETE schedule API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
370+ print ('DELETE schedule API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
371371 etag = resp .headers ['ETag' ]
372372 print ("\n {} is deleted from the {} with status code: {}\n " .format (testScheduleName , testVMwarePolicyName , resp .status_code ))
373373
@@ -380,7 +380,7 @@ def delete_netbackup_backupselections(jwt, base_url):
380380 resp = requests .delete (url , headers = headers , verify = False )
381381
382382 if resp .status_code != 204 :
383- raise Exception ('DELETE Backupselections API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
383+ print ('DELETE Backupselections API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
384384
385385 print ("\n BackupSelections is deleted for the {} with status code : {}\n " .format (testVMwarePolicyName , resp .status_code ))
386386
@@ -404,7 +404,7 @@ def put_netbackup_backupselections(jwt, base_url):
404404 resp = requests .put (url , headers = headers , json = req_body , verify = False )
405405
406406 if resp .status_code != 204 :
407- raise Exception ('PUT Backupselections API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
407+ print ('PUT Backupselections API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
408408 etag = resp .headers ['ETag' ]
409409 print ("\n Backupselections added to {} with status code: {}\n " .format (testVMwarePolicyName , resp .status_code ))
410410
@@ -501,6 +501,6 @@ def put_netbackup_schedule(jwt, base_url):
501501 resp = requests .put (url , headers = headers , json = req_body , verify = False )
502502
503503 if resp .status_code != 201 :
504- raise Exception ('PUT Schedule API failed with status code {} and {}' .format (resp .status_code , resp .json ()))
504+ print ('PUT Schedule API failed with status code {} and {}\n ' .format (resp .status_code , resp .json ()))
505505 etag = resp .headers ['ETag' ]
506506 print ("\n {} is added to {} with status code : {}\n " .format (testScheduleName , testVMwarePolicyName , resp .status_code ))
0 commit comments