File tree 1 file changed +5
-6
lines changed 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -501,16 +501,15 @@ def create_usp_agent_with_yaml(file):
501
501
if unknown_mtp_type :
502
502
for unknown_mtp_type in unknown_mtp_type :
503
503
print (f"Unknown MTP type: '{ unknown_mtp_type } ' is misspelled in the document." )
504
- return
504
+ sys . exit ( 1 )
505
505
506
506
# BETA
507
507
508
508
if "websockets" in found_mtp_type :
509
509
510
510
print (f"{ colours .yellowColour } \n [!] WebSockets is still on beta. Try it again with MQTT.\n { colours .endColour } " )
511
511
restore_usp_agent ()
512
- sleep (5 )
513
- return
512
+ sys .exit (1 )
514
513
515
514
# Check for unknown parameter types in the document
516
515
valid_parameter_types = {"Read Only" , "Read Write" }
@@ -520,7 +519,7 @@ def create_usp_agent_with_yaml(file):
520
519
if unknown_parameter_types :
521
520
for unknown_parameter_type in unknown_parameter_types :
522
521
print (f"Unknown type: '{ unknown_parameter_type } ' is misspelled in the document." )
523
- return
522
+ sys . exit ( 1 )
524
523
525
524
# Access the data model
526
525
seen_parameters = set ()
@@ -529,7 +528,7 @@ def create_usp_agent_with_yaml(file):
529
528
parameter = element ['parameter' ]
530
529
if not parameter .startswith ('Device.' ) or len (parameter .split ('.' )) < 2 :
531
530
print (f"Error: Parameter '{ parameter } ' on line { index } does not start with 'Device.' or is missing component after '.'." )
532
- return
531
+ sys . exit ( 1 )
533
532
534
533
if parameter in seen_parameters :
535
534
duplicate_parameters .add (parameter )
@@ -539,7 +538,7 @@ def create_usp_agent_with_yaml(file):
539
538
print ("Error: Duplicate parameters found:" )
540
539
for parameter in duplicate_parameters :
541
540
print (f" - { parameter } " )
542
- return
541
+ sys . exit ( 1 )
543
542
544
543
# CREATE USP AGENT
545
544
You can’t perform that action at this time.
0 commit comments