Commit e7f6a2a4 authored by kpetersn's avatar kpetersn
Browse files

Switched to using curl to grab the xml file. Python was having trouble when...

Switched to using curl to grab the xml file.  Python was having trouble when the script was run from the cron job.
parent 298016ab
......@@ -57,18 +57,26 @@ 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()
# 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