3232from conpot .utils .networking import str_to_bytes
3333import gevent
3434
35-
3635logger = logging .getLogger (__name__ )
3736
3837
@@ -333,7 +332,7 @@ def load_status(
333332 if status != 503 :
334333 # we're handling another error here.
335334 # generate a 503 response from configuration.
336- ( status , headers , trailers , payload , chunks ) = self .load_status (
335+ status , headers , trailers , payload , chunks = self .load_status (
337336 503 ,
338337 requeststring ,
339338 self .headers ,
@@ -497,7 +496,7 @@ def load_entity(self, requeststring, headers, configuration, docpath):
497496
498497 except :
499498 status = 503
500- ( status , headers , trailers , payload , chunks ) = self .load_status (
499+ status , headers , trailers , payload , chunks = self .load_status (
501500 status , requeststring , self .headers , headers , configuration , docpath
502501 )
503502
@@ -565,7 +564,7 @@ def send_error(self, code, message=None):
565564 logger .info (message )
566565
567566 # generate the appropriate status code, header and payload
568- ( status , headers , trailers , payload , chunks ) = self .load_status (
567+ status , headers , trailers , payload , chunks = self .load_status (
569568 code ,
570569 requeststring .partition ("?" )[0 ],
571570 self .headers ,
@@ -626,7 +625,7 @@ def do_TRACE(self):
626625 if self .server .disable_method_trace is True :
627626 # Method disabled by configuration. Fall back to 501.
628627 status = 501
629- ( status , headers , _ , payload , _ ) = self .load_status (
628+ status , headers , _ , payload , _ = self .load_status (
630629 status , self .path , self .headers , headers , configuration , docpath
631630 )
632631
@@ -689,7 +688,7 @@ def do_HEAD(self):
689688 if self .server .disable_method_head is True :
690689 # Method disabled by configuration. Fall back to 501.
691690 status = 501
692- ( status , headers , _ , _ , _ ) = self .load_status (
691+ status , headers , _ , _ , _ = self .load_status (
693692 status , self .path , self .headers , headers , configuration , docpath
694693 )
695694
@@ -709,14 +708,14 @@ def do_HEAD(self):
709708
710709 if entity_xml :
711710 # A config item exists for this entity. Handle it..
712- ( status , headers , _ , _ , _ ) = self .load_entity (
711+ status , headers , _ , _ , _ = self .load_entity (
713712 self .path , headers , configuration , docpath
714713 )
715714
716715 else :
717716 # No config item could be found. Fall back to a standard 404..
718717 status = 404
719- ( status , headers , _ , _ , _ ) = self .load_status (
718+ status , headers , _ , _ , _ = self .load_status (
720719 status , self .path , self .headers , headers , configuration , docpath
721720 )
722721
@@ -762,7 +761,7 @@ def do_OPTIONS(self):
762761 if self .server .disable_method_options is True :
763762 # Method disabled by configuration. Fall back to 501.
764763 status = 501
765- ( status , headers , _ , payload , _ ) = self .load_status (
764+ status , headers , _ , payload , _ = self .load_status (
766765 status , self .path , self .headers , headers , configuration , docpath
767766 )
768767
@@ -846,14 +845,14 @@ def do_GET(self):
846845
847846 if entity_xml :
848847 # A config item exists for this entity. Handle it..
849- ( status , headers , trailers , payload , chunks ) = self .load_entity (
848+ status , headers , trailers , payload , chunks = self .load_entity (
850849 self .path , headers , configuration , docpath
851850 )
852851
853852 else :
854853 # No config item could be found. Fall back to a standard 404..
855854 status = 404
856- ( status , headers , trailers , payload , chunks ) = self .load_status (
855+ status , headers , trailers , payload , chunks = self .load_status (
857856 status , self .path , self .headers , headers , configuration , docpath , "GET"
858857 )
859858
@@ -914,14 +913,14 @@ def do_POST(self):
914913
915914 if entity_xml :
916915 # A config item exists for this entity. Handle it..
917- ( status , headers , trailers , payload , chunks ) = self .load_entity (
916+ status , headers , trailers , payload , chunks = self .load_entity (
918917 self .path , headers , configuration , docpath
919918 )
920919
921920 else :
922921 # No config item could be found. Fall back to a standard 404..
923922 status = 404
924- ( status , headers , trailers , payload , chunks ) = self .load_status (
923+ status , headers , trailers , payload , chunks = self .load_status (
925924 status ,
926925 self .path ,
927926 self .headers ,
0 commit comments