def _get_report_id(self):
if self.watch:<EOL><INDENT>pipeline_path = get_nextflow_filepath(self.log_file)<EOL>pipeline_hash = hashlib.md5()<EOL>with open(pipeline_path, "<STR_LIT:rb>") as fh:<EOL><INDENT>for chunk in iter(lambda: fh.read(<NUM_LIT>), b"<STR_LIT>"):<EOL><INDENT>pipeline_hash.update(chunk)<EOL><DEDENT><DEDENT>workdir = os.getcwd().encode("<STR_LIT:utf8>")<EOL>hostname = socket.gethostname().encode("<STR_LIT:utf8>")<EOL>hardware_addr = str(uuid.getnode()).encode("<STR_LIT:utf8>")<EOL>dir_hash = hashlib.md5(workdir + hostname + hardware_addr)<EOL>return pipeline_hash.hexdigest() + dir_hash.hexdigest()<EOL><DEDENT>else:<EOL><INDENT>with open(self.report_file) as fh:<EOL><INDENT>report_json = json.loads(fh.read())<EOL><DEDENT>metadata = report_json["<STR_LIT:data>"]["<STR_LIT>"][<NUM_LIT:0>]["<STR_LIT>"]<EOL>try:<EOL><INDENT>report_id = metadata["<STR_LIT>"] + metadata["<STR_LIT>"]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise eh.ReportError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>return report_id<EOL><DEDENT>
Returns a hash of the reports JSON file