File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -486,16 +486,20 @@ def logs(self, log_lines=str(settings.LOG_LINES)):
486486 except requests .exceptions .RequestException as e :
487487 logger .error ("Error accessing deis-logger using url '{}': {}" .format (url , e ))
488488 raise e
489+
489490 # Handle logs empty or not found
490491 if r .status_code == 204 or r .status_code == 404 :
491492 logger .info ("GET {} returned a {} status code" .format (url , r .status_code ))
492493 raise EnvironmentError ('Could not locate logs' )
494+
493495 # Handle unanticipated status codes
494496 if r .status_code != 200 :
495497 logger .error ("Error accessing deis-logger: GET {} returned a {} status code"
496498 .format (url , r .status_code ))
497499 raise EnvironmentError ('Error accessing deis-logger' )
498- return r .content
500+
501+ # cast content to string since it comes as bytes via the requests object
502+ return str (r .content )
499503
500504 def run (self , user , command ):
501505 """Run a one-off command in an ephemeral app container."""
You can’t perform that action at this time.
0 commit comments