#NEWLINE# @ must_be_signed #NEWLINE# @ must_have_addon ( 'osfstorage' , 'node' ) #NEWLINE# def osfstorage_update_metadata( node_addon , payload , **kwargs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# version_id = payload [ 'version' ] #NEWLINE# metadata = payload [ 'metadata' ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise HTTPError ( httplib . BAD_REQUEST ) #NEWLINE# #UNINDENT# version = models . FileVersion . load ( version_id ) #NEWLINE# if ( version is None ) : #NEWLINE# #INDENT# raise HTTPError ( httplib . NOT_FOUND ) #NEWLINE# #UNINDENT# version . update_metadata ( metadata ) #NEWLINE# return { #NEWLINE# #INDENT# 'status' : 'success' , #NEWLINE# #UNINDENT# }