def register_crash(crash):

    if len(crash.keys()) <= 0:
        return

    base = 'http://{0}:{1}'.format(config.SERVER_IP, config.SERVER_PORT)
    uri = '/node/%d/?crash={0}' % config.NODE_ID
    for (cidx, cpath) in crash.iteritems():

        try:
            response = requests.get(base + uri.format(cidx))
            if response.status_code is 200 and "Invalid crash" in response.content:

                # crash does not exist on server, POST it
                data = {
                    "node_id": config.NODE_ID,
                    "skey": sha256(config.SERVER_KEY).hexdigest(),
                    "crash_idx": str(cidx),
                    "crash": open(cpath).read()
                }

                response = requests.post(base + "/crash/", data=json.dumps(data))
                if response.status_code is 200 and "Node updated" in response.content:
                    utility.msg("Crash %s posted successfully" % cidx, LOG)
                else:
                    utility.msg("Failed to post crash %s: %s" % (cidx, response.content), ERROR)
                    
        except Exception, e:
            utility.msg("Error contacting remote server: %s" % e, ERROR)
Accepts a dictionary of {crash_idx : crash_file_path} and attempts to
dataset/ETHPy150Open hatRiot/PeachOrchard/node/src/core/node_resource.py/register_crash