65a21f5c7cdda8de27c2054ddffdd391284c3aa1 hiram Mon Jun 1 09:03:06 2026 -0700 switching entirely to genome-centdb hgcentral refs #31811 diff --git src/hg/utils/otto/userRequests/ottoRequest.py src/hg/utils/otto/userRequests/ottoRequest.py index caccd849924..80171c95fdb 100755 --- src/hg/utils/otto/userRequests/ottoRequest.py +++ src/hg/utils/otto/userRequests/ottoRequest.py @@ -126,33 +126,33 @@ return rows for line in result.stdout.strip().split('\n'): fields = [unescapeMysql(f) for f in line.split('\t')] rows.append({ 'id': fields[0], 'requestType': fields[1], 'fromDb': fields[2], 'toDb': fields[3], 'email': fields[4], 'comment': fields[5], 'requestTime': fields[6], }) return rows -def hgsqlUpdate(db, sql): +def hgsqlUpdate(host, db, sql): """Run a SQL update/insert statement via hgsql.""" - cmd = ['/cluster/bin/x86_64/hgsql', db, '-N', '-B', '-e', sql] + cmd = ['/cluster/bin/x86_64/hgsql', '-h', host, db, '-N', '-B', '-e', sql] result = subprocess.run(cmd, capture_output=True, text=True) if result.returncode != 0: print(f"hgsql update error: {result.stderr.strip()}", file=sys.stderr) return False return True def parseAssemblyComment(comment): """Assembly requests pack fields into the ottoRequest.comment column via hubApi/findGenome.c:apiAssemblyRequest: name: '<name>'[; betterName: '<bn>'][; comment: '<user comment>'] The user comment may itself contain newlines and apostrophes, so the inner quote pair is matched greedily up to the trailing closing quote. re.DOTALL lets '.' span newlines. Return (name, betterName, userComment).""" @@ -277,24 +277,24 @@ f"processed.\n" f"\n" f"Request details:\n" f" From: {req['fromDb']}\n" f" To: {req['toDb']}\n" f" Comment: {req['comment'].rstrip()}\n" f" Submitted: {req['requestTime']}\n" f"\n" f"Will advise when this alignment is available in the genome browser.\n" f"\n" f"-- UCSC Genome Browser\n" ) bitParts = ["gb", "aut", "o", "@", "uc", "sc.", "ed", "u"] if sendMail(userEmail, subject, body, fromAddr=NOTIFY_FROM, bccAddr=bccAddr, bounceAddr="".join(bitParts)): - hgsqlUpdate(ottoDb, f"UPDATE {ottoTable} SET status = 1" + hgsqlUpdate(dbHost, ottoDb, f"UPDATE {ottoTable} SET status = 1" f" WHERE id = {req['id']}") else: print(f"Failed to send notification for request #{req['id']}", file=sys.stderr) if __name__ == '__main__': main()