a576b64a56b2de30e8bb2423b0216e4de4abd122
lrnassar
  Mon Nov 22 13:29:44 2021 -0800
Adding user agent to emmulate connection from RR, and adding fail flag and timeout to reduce hanging on specific URLs. No RM.

diff --git src/utils/qa/hubPublicAutoUpdate src/utils/qa/hubPublicAutoUpdate
index 91a26c8..da2847f 100755
--- src/utils/qa/hubPublicAutoUpdate
+++ src/utils/qa/hubPublicAutoUpdate
@@ -72,31 +72,31 @@
         hubPublicDic[hub[0]] = {'hubUrl':hub[0],'shortLabel':hub[1],'longLabel':hub[2],\
                             'registrationTime':hub[3],'dbCount':hub[4],\
                             'dbList':hub[5],'descriptionUrl':hub[5]}
     return(hubPublicDic)
 
 def escapeDoubleQuotesOnLabels(label):
     """Look for single and double quotes in labels"""
     if '"' in label:
         label = label.replace('"','\\"')
     if "'" in label:
         label = label.replace("'","\\'")
     return(label)
 
 def curl(url):
     """Run curl command on URL - for http + ftp support"""
-    rawCurlOutput = subprocess.run("curl -skL "+url,\
+    rawCurlOutput = subprocess.run("curl --user-agent \"genome.ucsc.edu/net.c\" -skL --fail --connect-timeout 10.0 "+url,\
                          check=True, shell=True, stdout=subprocess.PIPE, universal_newlines=True)
     curlStdout = rawCurlOutput.stdout
     return(curlStdout)
 
 def buildCurrentHubTxtDic(hub):
     """Query hub.txt file and build dic of values"""
     currentHub = {}
     response = curl(hub)
     for line in response.splitlines():
         if "\t" in line.rstrip():
             line = line.split("\t")
             currentHub[line[0]] = line[1]
         else:
             line = line.split(" ")
             currentHub[line[0]] = " ".join(line[1:])