@@ -483,17 +483,22 @@ if __name__ == "__main__":
483483 if not configuration_source_set or len (configuration_source_set .configuration_source_set ) == 0 :
484484 print ('No configuration sources available' )
485485 else :
486- print (' {0}' .format (configuration_source_set .to_string ()))
486+ print ('Successfully listed configuration sources' )
487+ print ('-----------------------------------------' )
488+ print (response .model .to_json ())
487489 sys .exit (0 )
488490 else :
489491 sys .exit (1 )
490492
491493 if options .list_configuration_source :
492494 response = tsp_client .fetch_configuration_source (options .list_configuration_source )
493495 if response .status_code == 200 :
494- print (' {0}' .format (response .model .to_string ()))
496+ print ('Successfully listed configuration source' )
497+ print ('----------------------------------------' )
498+ print (response .model .to_json ())
495499 sys .exit (0 )
496500 else :
501+ print ('No such configuration source' )
497502 sys .exit (1 )
498503
499504 if options .list_configurations :
@@ -503,7 +508,9 @@ if __name__ == "__main__":
503508 if not configuration_set or len (configuration_set .configuration_set ) == 0 :
504509 print ('No configurations loaded' )
505510 else :
506- print (' {0}' .format (configuration_set .to_string ()))
511+ print ('Successfully listed configurations' )
512+ print ('----------------------------------' )
513+ print (response .model .to_json ())
507514 sys .exit (0 )
508515 else :
509516 sys .exit (1 )
@@ -513,9 +520,12 @@ if __name__ == "__main__":
513520 if options .type_id is not None :
514521 response = tsp_client .fetch_configuration (options .type_id , options .list_configuration )
515522 if response .status_code == 200 :
516- print (' {0}' .format (response .model .to_string ()))
523+ print ('Successfully listed configuration' )
524+ print ('---------------------------------' )
525+ print (response .model .to_json ())
517526 sys .exit (0 )
518527 else :
528+ print ('No such configuration' )
519529 sys .exit (1 )
520530 else :
521531 print ("No type id of configuration provided" )
@@ -530,7 +540,9 @@ if __name__ == "__main__":
530540 if (params is not None ):
531541 response = tsp_client .post_configuration (options .type_id , params )
532542 if response .status_code == 200 :
533- print (' {0}' .format (response .model .to_string ()))
543+ print ('Successfully loaded configuration' )
544+ print ('---------------------------------' )
545+ print (response .model .to_json ())
534546 sys .exit (0 )
535547 else :
536548 sys .exit (1 )
@@ -552,7 +564,9 @@ if __name__ == "__main__":
552564 if (params is not None ):
553565 response = tsp_client .put_configuration (options .type_id , options .config_id , params )
554566 if response .status_code == 200 :
555- print (' {0}' .format (response .model .to_string ()))
567+ print ('Successfully updated configuration' )
568+ print ('---------------------------------' )
569+ print (response .model .to_json ())
556570 sys .exit (0 )
557571 else :
558572 sys .exit (1 )
@@ -573,7 +587,9 @@ if __name__ == "__main__":
573587 if options .type_id is not None :
574588 response = tsp_client .delete_configuration (options .type_id , options .delete_configuration )
575589 if response .status_code == 200 :
576- print (' {0}' .format (response .model .to_string ()))
590+ print ('Successfully deleted configuration' )
591+ print ('---------------------------------' )
592+ print (response .model .to_json ())
577593 sys .exit (0 )
578594 else :
579595 sys .exit (1 )
0 commit comments