diff --git a/transport/__init__.py b/transport/__init__.py index 86d7fce..15f8f8d 100644 --- a/transport/__init__.py +++ b/transport/__init__.py @@ -151,7 +151,7 @@ def instance(**_args): try: host = '' - if provider not in ['bigquery','mongodb','couchdb','sqlite','console','etl','file','rabbitmq'] : + if provider not in ['bigquery','mongodb','mongo','couchdb','sqlite','console','etl','file','rabbitmq'] : # # In these cases we are assuming RDBMS and thus would exclude NoSQL and BigQuery username = args['username'] if 'username' in args else '' @@ -169,7 +169,7 @@ def instance(**_args): account = '' host = '' database = args['path'] if 'path' in args else args['database'] - if provider not in ['mongodb','couchdb','bigquery','console','etl','file','rabbitmq'] : + if provider not in ['mongodb','mongo','couchdb','bigquery','console','etl','file','rabbitmq'] : uri = ''.join([provider,"://",account,host,'/',database]) e = sqlalchemy.create_engine (uri,future=True) diff --git a/transport/mongo.py b/transport/mongo.py index 8f593c3..7cb89c3 100644 --- a/transport/mongo.py +++ b/transport/mongo.py @@ -38,7 +38,7 @@ class Mongo : host = ":".join([host,port]) #-- Formatting host information here self.uid = args['doc'] if 'doc' in args else None #-- document identifier self.dbname = args['dbname'] if 'dbname' in args else args['db'] - + authMechanism= 'SCRAM-SHA-256' if 'mechanism' not in args else args['mechanism'] self._lock = False if 'lock' not in args else args['lock'] username = password = None @@ -49,6 +49,9 @@ class Mongo : _info = json.loads((open(args['auth_file'])).read()) username = _info['username'] password = _info['password'] + if 'mechanism' in _info: + authMechanism = _info['mechanism'] + authSource=(args['authSource'] if 'authSource' in args else self.dbname) if username and password :