mirror of
https://github.com/yweber/lodel2.git
synced 2025-12-03 17:26:54 +01:00
Added connection arguments check
This commit is contained in:
parent
77d6fd8df5
commit
a37fc6da2d
1 changed files with 4 additions and 0 deletions
|
|
@ -38,6 +38,10 @@ class MongoDbMigrationHandler(object):
|
|||
if len(conn_args.keys()) == 0:
|
||||
raise MigrationHandlerError("No connection arguments were given")
|
||||
|
||||
if 'host' not in conn_args.keys() or 'port' not in conn_args.keys() or 'db_name' not in conn_args.keys() \
|
||||
or 'username' not in conn_args.keys() or 'password' not in conn_args.keys():
|
||||
raise MigrationHandlerError("Missing connection arguments")
|
||||
|
||||
#self.connection_name = conn_args['name']
|
||||
self.database = connect(host=conn_args['host'], port=conn_args['port'], db_name=conn_args['db_name'],
|
||||
username=conn_args['username'], password=conn_args['password'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue