Merge "Fix mongodb collection name"

This commit is contained in:
Jenkins 2015-06-18 17:49:23 +00:00 committed by Gerrit Code Review
commit 36bf0e05d2
5 changed files with 11 additions and 11 deletions

View File

@ -26,7 +26,7 @@ class HostHandler(handler.Handler):
def get(self, host_name):
"""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}
)
@ -46,10 +46,10 @@ class HostHandler(handler.Handler):
if fields != {}:
mongo_dicts = (self.request.mongo_connection.
shinken_live.hosts.find(query, fields))
alignak_live.hosts.find(query, fields))
else:
mongo_dicts = (self.request.mongo_connection.
shinken_live.hosts.find(query))
alignak_live.hosts.find(query))
host_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:
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):
"""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,
"service_description": service_description},
)
@ -46,10 +46,10 @@ class ServiceHandler(handler.Handler):
if fields != {}:
mongo_dicts = (self.request.mongo_connection.
shinken_live.services.find(query, fields))
alignak_live.services.find(query, fields))
else:
mongo_dicts = (self.request.mongo_connection.
shinken_live.services.find(query))
alignak_live.services.find(query))
service_dicts = [
_service_dict_from_mongo_item(s) for s in mongo_dicts

View File

@ -72,7 +72,7 @@ class TestStatusHosts(functionalTest.FunctionalTest):
"services": [],
},
]
self.mongoconnection.shinken_live.hosts.insert(
self.mongoconnection.alignak_live.hosts.insert(
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)
)

View File

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

View File

@ -56,7 +56,7 @@ RUN cd /tmp && \
# mod-mongo-live-config
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 && \
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*