Load config from file
Change-Id: Ieb11d74efda7e51f16c2bf0aa1c1efb9680536c1
This commit is contained in:
parent
ae360321c4
commit
8bf6fb7863
@ -35,6 +35,7 @@ ADD surveil /opt/surveil/surveil
|
|||||||
ENV PBR_VERSION=PROD
|
ENV PBR_VERSION=PROD
|
||||||
|
|
||||||
# We are using develop so that the code can be mounted when in DEV.
|
# We are using develop so that the code can be mounted when in DEV.
|
||||||
|
RUN pip install -U six
|
||||||
RUN cd /opt/surveil && python setup.py develop
|
RUN cd /opt/surveil && python setup.py develop
|
||||||
|
|
||||||
#Set to 'surveil' or 'keystone'
|
#Set to 'surveil' or 'keystone'
|
||||||
|
4
etc/surveil/surveil.cfg
Normal file
4
etc/surveil/surveil.cfg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[surveil]
|
||||||
|
mongodb_uri= mongodb://mongo:27017
|
||||||
|
ws_arbiter_url= http://alignak:7760
|
||||||
|
influxdb_uri= influxdb://root:root@influxdb:8086/db
|
@ -9,3 +9,4 @@ oslo.policy>=0.3.0
|
|||||||
keystonemiddleware
|
keystonemiddleware
|
||||||
PasteDeploy
|
PasteDeploy
|
||||||
influxdb==2.0.1
|
influxdb==2.0.1
|
||||||
|
six
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from six.moves import configparser
|
||||||
|
|
||||||
from surveil.api import hooks
|
from surveil.api import hooks
|
||||||
|
|
||||||
@ -21,13 +22,13 @@ server = {
|
|||||||
'host': '0.0.0.0'
|
'host': '0.0.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read("/etc/surveil/surveil.cfg")
|
||||||
|
|
||||||
# In the future, surveil_api_config could be loaded from somewhere else,
|
|
||||||
# as long as is it in the same format.
|
|
||||||
surveil_api_config = {
|
surveil_api_config = {
|
||||||
"mongodb_uri": "mongodb://mongo:27017",
|
"mongodb_uri": config.get("surveil", "mongodb_uri"),
|
||||||
"ws_arbiter_url": "http://alignak:7760",
|
"ws_arbiter_url": config.get("surveil", "ws_arbiter_url"),
|
||||||
"influxdb_uri": "influxdb://root:root@influxdb:8086/db"
|
"influxdb_uri": config.get("surveil", "influxdb_uri")
|
||||||
}
|
}
|
||||||
|
|
||||||
app_hooks = [
|
app_hooks = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user