#NEWLINE# def __init__( self , assetstore ) : #NEWLINE# #INDENT# '\n        :param assetstore: The assetstore to act on.\n        ' #NEWLINE# super ( GridFsAssetstoreAdapter , self ) . __init__ ( assetstore ) #NEWLINE# try : #NEWLINE# #INDENT# self . chunkColl = getDbConnection ( self . assetstore . get ( 'mongohost' , None ) , self . assetstore . get ( 'replicaset' , None ) ) [ self . assetstore [ 'db' ] ] . chunk #NEWLINE# #UNINDENT# except pymongo . errors . ConnectionFailure : #NEWLINE# #INDENT# logger . error ( 'Failed to connect to GridFS assetstore %s' , self . assetstore [ 'db' ] ) #NEWLINE# self . chunkColl = 'Failed to connect' #NEWLINE# self . unavailable = True #NEWLINE# return #NEWLINE# #UNINDENT# except pymongo . errors . ConfigurationError : #NEWLINE# #INDENT# logger . exception ( 'Failed to configure GridFS assetstore %s' , assetstore . assetstore [ 'db' ] ) #NEWLINE# self . chunkColl = 'Failed to configure' #NEWLINE# self . unavailable = True #NEWLINE# return