Update the port to be an integer.
Fix the port to be an integer. Use the format function for string formatting.
@@ -4,7 +4,6 @@ from st2reactor.sensor.base import Sensor
class EchoFlaskSensor(Sensor):
-
def __init__(self, sensor_service, config):
super(EchoFlaskSensor, self).__init__(
sensor_service=sensor_service,
@@ -12,7 +11,7 @@ class EchoFlaskSensor(Sensor):
)
self._host = '127.0.0.1'
- self._port = '5000'
+ self._port = 5000
self._path = '/echo'
self._log = self._sensor_service.get_logger(__name__)
@@ -29,8 +28,8 @@ class EchoFlaskSensor(Sensor):
payload=payload)
return request.data
- self._log.info('Listening for payload on http://%s:%s%s' %
- (self._host, self._port, self._path))
+ self._log.info('Listening for payload on http://{}:{}{}'.format(
+ self._host, self._port, self._path))
self._app.run(host=self._host, port=self._port, threaded=True)
def cleanup(self):
