better defaults, fix wrong wsgi interface

This commit is contained in:
Christian Klopp 2018-04-05 14:05:57 +02:00
parent 900541b3b2
commit 262d6b65fb
3 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@ SSL_CA=${SSL_CA-"/etc/openmtc/certs/ca-chain.cert.pem"}
ORION_HOST=${ORION_HOST-"http://localhost:1026"}
ORION_API=${ORION_API-"v2"}
ACCUMULATE_ADDRESS=${ACCUMULATE_ADDRESS-"http://localhost:8080"}
LABELS=${LABELS-'["openmtc:sensor_data"]'}
# defaults logging
LOGGING_FILE=${LOGGING_FILE-"/var/log/openmtc/orioncontextbroker.log"}
@ -48,6 +49,7 @@ JQ_STRING=${JQ_STRING}' |
.orion_host = "'${ORION_HOST}'" |
.orion_api = "'${ORION_API}'" |
.accumulate_address = "'${ACCUMULATE_ADDRESS}'" |
.labels = '${LABELS}' |
.ssl_certs.cert_file = "'${SSL_CRT}'" |
.ssl_certs.key_file = "'${SSL_KEY}'" |
.ssl_certs.ca_certs = "'${SSL_CA}'" |

View File

@ -15,7 +15,7 @@
"level": "INFO",
"file": "/var/log/openmtc/orioncontextbroker.log"
},
"labels": [],
"labels": ["openmtc:sensor_data"],
"interval": 10,
"orion_host": "http://localhost:1026",
"orion_api": "v2"

View File

@ -10,7 +10,7 @@ class OrionContextBroker(ResourceManagementXAE):
def __init__(self,
orion_host="http://localhost:1026",
orion_api="v2",
labels=None,
labels=["openmtc:sensor_data"],
accumulate_address="http://localhost:8080",
*args,
**kw):
@ -38,7 +38,7 @@ class OrionContextBroker(ResourceManagementXAE):
methods=["POST"])
accumulate_ip, accumulate_port = accumulate_address.split('//')[
1].split(':')
self.server = wsgi.WSGIServer((accumulate_ip, int(accumulate_port)),
self.server = wsgi.WSGIServer(("0.0.0.0", int(accumulate_port)),
self.app)
self.server.start()