Commit 260549f9 authored by kpetersn's avatar kpetersn
Browse files

Switched back to not using curl. Added comment about using curl to work around proxy problems.

parent e7f6a2a4
......@@ -57,26 +57,24 @@ ioc_url = "http://bcda.xray.aps.anl.gov/cgi-bin/ioc_alive.cgi?ioc="
hb_period = 10
ioc_list = {}
# Use curl to get the xml file to avoid python problems from cron job
#!print "Curling URL"
command = "curl -s %s" % alive_url
p = os.popen(command, 'r')
xml_string = p.read()
p.close()
# Get the xml file
#!print "Opening URL"
#!try:
#! f = urllib.urlopen(alive_url)
#!except IOError:
#! print "Couldn't open URL"
#! sys.exit(1)
try:
f = urllib.urlopen(alive_url)
except IOError:
print "Couldn't open URL"
sys.exit(1)
#!print "Reading XML from URL"
#!xml_string = f.read()
xml_string = f.read()
#!print "Closing URL"
#!f.close()
f.close()
# Use curl to get the xml file if you have web proxy problems
#!print "Curling URL"
#!command = "curl -s %s" % alive_url
#!p = os.popen(command, 'r')
#!xml_string = p.read()
#!p.close()
# Parse the xml string
#!print "Parsing XML"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment