openfaas / python-flask-template

HTTP and Flask-based OpenFaaS templates for Python 3
MIT License
85 stars 86 forks source link

Set default value for HOSTNAME for python3-http templates #27

Closed mehyedes closed 4 years ago

mehyedes commented 4 years ago

The HOSTNAME environment variable is not available in faasd, which makes any function using the python3-http template fail with the following error with a KeyError exception.

Setting a default value should fix this issue

Signed-off-by: Mehdi Yedes mehdi.yedes@gmail.com

alexellis commented 4 years ago

Thank you @mehyedes

Just to note for anyone who lands here, this issue was seen with faasd and when running the template directly on MacOS outside of a container where HOSTNAME wasn't available as an env-var.