# HG changeset patch # User James Callahan # Date 1323827269 -39600 # Node ID 46f578da4ff05658011ec31017ba913a3431043a # Parent 0e07810550c8c06a2ecc3fe4c90e541b1f606116 mod_storage_mongodb: assert the configuration options diff -r 0e07810550c8 -r 46f578da4ff0 mod_storage_mongodb/mod_storage_mongodb.lua --- a/mod_storage_mongodb/mod_storage_mongodb.lua Tue Dec 13 12:30:01 2011 +1100 +++ b/mod_storage_mongodb/mod_storage_mongodb.lua Wed Dec 14 12:47:49 2011 +1100 @@ -1,8 +1,7 @@ local next = next; local setmetatable = setmetatable; -local log = require "util.logger".init("mongodb"); -local params = module:get_option("mongodb"); +local params = assert ( module:get_option("mongodb") , "mongodb configuration not found" ); local mongo = require "mongo"; @@ -17,6 +16,7 @@ local host = module.host or "_global"; local store = self.store; + -- The database name can't have a period in it (hence it can't be a host/ip) local namespace = params.dbname .. "." .. host; local v = { _id = { store = store ; username = username } }; @@ -32,6 +32,7 @@ local host = module.host or "_global"; local store = self.store; + -- The database name can't have a period in it (hence it can't be a host/ip) local namespace = params.dbname .. "." .. host; local v = { _id = { store = store ; username = username } };