Fix mongodb collection name

Change-Id: I9feaa13529a0e96f7485b73ec88cda964bbc7980
This commit is contained in:
Thibault Cohen 2015-06-18 12:56:05 -04:00
parent 3ed73dc0b2
commit 714ff4b4f7
5 changed files with 11 additions and 11 deletions

View File

@ -26,7 +26,7 @@ class HostHandler(handler.Handler):
def get(self, host_name): def get(self, host_name):
"""Return a host.""" """Return a host."""
mongo_s = self.request.mongo_connection.shinken_live.hosts.find_one( mongo_s = self.request.mongo_connection.alignak_live.hosts.find_one(
{"host_name": host_name} {"host_name": host_name}
) )
@ -46,10 +46,10 @@ class HostHandler(handler.Handler):
if fields != {}: if fields != {}:
mongo_dicts = (self.request.mongo_connection. mongo_dicts = (self.request.mongo_connection.
shinken_live.hosts.find(query, fields)) alignak_live.hosts.find(query, fields))
else: else:
mongo_dicts = (self.request.mongo_connection. mongo_dicts = (self.request.mongo_connection.
shinken_live.hosts.find(query)) alignak_live.hosts.find(query))
host_dicts = [ host_dicts = [
_host_dict_from_mongo_item(s) for s in mongo_dicts _host_dict_from_mongo_item(s) for s in mongo_dicts
@ -112,4 +112,4 @@ def _host_dict_from_mongo_item(mongo_item):
if value is not None: if value is not None:
mongo_item[field[1]] = field[2](value) mongo_item[field[1]] = field[2](value)
return mongo_item return mongo_item

View File

@ -26,7 +26,7 @@ class ServiceHandler(handler.Handler):
def get(self, host_name, service_description): def get(self, host_name, service_description):
"""Return a specific service.""" """Return a specific service."""
mongo_s = self.request.mongo_connection.shinken_live.services.find_one( mongo_s = self.request.mongo_connection.alignak_live.services.find_one(
{"host_name": host_name, {"host_name": host_name,
"service_description": service_description}, "service_description": service_description},
) )
@ -46,10 +46,10 @@ class ServiceHandler(handler.Handler):
if fields != {}: if fields != {}:
mongo_dicts = (self.request.mongo_connection. mongo_dicts = (self.request.mongo_connection.
shinken_live.services.find(query, fields)) alignak_live.services.find(query, fields))
else: else:
mongo_dicts = (self.request.mongo_connection. mongo_dicts = (self.request.mongo_connection.
shinken_live.services.find(query)) alignak_live.services.find(query))
service_dicts = [ service_dicts = [
_service_dict_from_mongo_item(s) for s in mongo_dicts _service_dict_from_mongo_item(s) for s in mongo_dicts

View File

@ -72,7 +72,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"services": [], "services": [],
}, },
] ]
self.mongoconnection.shinken_live.hosts.insert( self.mongoconnection.alignak_live.hosts.insert(
copy.deepcopy(self.host) copy.deepcopy(self.host)
) )
@ -99,7 +99,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
}, },
] ]
self.mongoconnection.shinken_live.services.insert( self.mongoconnection.alignak_live.services.insert(
copy.deepcopy(self.services) copy.deepcopy(self.services)
) )

View File

@ -46,7 +46,7 @@ class TestStatusServices(functionalTest.FunctionalTest):
"problem_has_been_acknowledged": False, "problem_has_been_acknowledged": False,
}, },
] ]
self.mongoconnection.shinken_live.services.insert( self.mongoconnection.alignak_live.services.insert(
copy.deepcopy(self.services) copy.deepcopy(self.services)
) )

View File

@ -56,7 +56,7 @@ RUN cd /tmp && \
# mod-mongo-live-config # mod-mongo-live-config
RUN cd /tmp && \ RUN cd /tmp && \
wget -O mod-mongo-live-config.tar.gz https://github.com/savoirfairelinux/mod-mongo-live-config/archive/0.3.0.tar.gz && \ wget -O mod-mongo-live-config.tar.gz https://github.com/savoirfairelinux/mod-mongo-live-config/archive/0.3.2.tar.gz && \
tar -zxvf mod-mongo-live-config.tar.gz && \ tar -zxvf mod-mongo-live-config.tar.gz && \
mv /tmp/mod-mongo-live-config-*/mod_mongo_live_config /var/lib/alignak/modules/mod_mongo_live_config && \ mv /tmp/mod-mongo-live-config-*/mod_mongo_live_config /var/lib/alignak/modules/mod_mongo_live_config && \
rm -rfv /tmp/mod-mongo-live-config* rm -rfv /tmp/mod-mongo-live-config*