#NEWLINE# @ app . route ( '/admin/report_metadata' , methods = [ 'POST' ] ) #NEWLINE# def report_metadata( ) : #NEWLINE# #INDENT# ' Internal endpoint for zk_download_data to report metadata\n    ' #NEWLINE# zk_path = str ( request . form . getlist ( 'zk_path' ) [ 0 ] ) #NEWLINE# mode = str ( request . form . getlist ( 'mode' ) [ 0 ] ) #NEWLINE# notification_timestamp = float ( request . form . getlist ( 'notification_timestamp' ) [ 0 ] ) #NEWLINE# modification_timestamp = float ( request . form . getlist ( 'modification_timestamp' ) [ 0 ] ) #NEWLINE# if ( mode == 'SERVERSET' ) : #NEWLINE# #INDENT# hashsum = int ( request . form . getlist ( 'hashsum' ) [ 0 ] ) #NEWLINE# num_endpoints = int ( request . form . getlist ( 'num_endpoints' ) [ 0 ] ) #NEWLINE# try : #NEWLINE# #INDENT# _SERVERSET_METADATA [ zk_path ] . update ( { #NEWLINE# #INDENT# 'hashsum' : hashsum , #NEWLINE# 'num_endpoints' : num_endpoints , #NEWLINE# 'notification_timestamp' : notification_timestamp , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# log . error ( 'Serverset {} is not loaded into dict but metadata is being reported' . format ( zk_path ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# version = int ( request . form . getlist ( 'version' ) [ 0 ] ) #NEWLINE# try : #NEWLINE# #INDENT# _PATH_TO_DATA [ zk_path ] . update ( { #NEWLINE# #INDENT# 'version' : version , #NEWLINE# 'notification_timestamp' : notification_timestamp , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# log . error ( 'Config {} is not loaded into dict but metadata is being reported' . format ( zk_path ) ) #NEWLINE# #UNINDENT# #UNINDENT# _update_modification_timestamp_for_flask ( mode , zk_path , modification_timestamp ) #NEWLINE# return ''