def METHOD_NAME(self, status):
    status_file = None
    try:
        status_file = open(_EEPROM_STATUS, "w")
        status_file.write(status)
    except IOError as e:
        logging.error("Failed to report state: %s" % (str(e)))
    finally:
        if status_file is not None:
            status_file.close()