def populate(): print "Begin MAC Address population ..." try: with Timeout(300): oui.update() except Exception, e: print e print traceback.format_exc()
def populate(): print("Begin MAC Address population ...") try: with Timeout(300): oui.update() except Exception as e: print(e) print(traceback.format_exc()) # Response needed for local execution which runs shorter than 2 mins finally: data = {'message': 'Whoaa! MacReduce Data Populated/Refreshed'} message = json.dumps(data) print(message) resp = Response(message, status=200, mimetype='application/json') return resp
def populate(): print("Begin MAC Address population ...") try: with Timeout(300): oui.update() except Exception as e: print(e) print(traceback.format_exc()) # Response needed for local execution which runs shorter than 2 mins finally: data = { 'message': 'Whoaa! MacReduce Data Populated/Refreshed' } message = json.dumps(data) print(message) resp = Response(message, status=200, mimetype='application/json') return resp