Commit 298016ab authored by kpetersn's avatar kpetersn
Browse files

Modified test.py to use curl instead of python for grabbing the xml. Seems to fix the problem.

parent f00719f8
......@@ -6,6 +6,9 @@ import os
alive_url = "http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi"
#!os.setgid(104)
#!os.setegid(104)
# function for troubleshooting
def get_xml(alive_url):
# Get the xml file
......@@ -22,6 +25,15 @@ def get_xml(alive_url):
f.close()
return xml_string
def curl_xml(alive_url):
# Get the xml file
print "Curling URL"
command = "curl -s %s" % alive_url
p = os.popen(command, 'r')
xml_string = p.read()
p.close()
return xml_string
def open_xml(xml_string):
try:
root = ET.fromstring(xml_string)
......@@ -35,9 +47,14 @@ def open_xml(xml_string):
return retval
def xml_test(alive_url):
xml_string = get_xml(alive_url)
#!xml_string = get_xml(alive_url)
xml_string = curl_xml(alive_url)
if xml_string != None:
print open_xml(xml_string)
print "uid = %i, gid = %i" % (os.getuid(), os.getgid())
print "euid = %i, egid = %i" % (os.geteuid(), os.getegid())
#!print
#!print os.system("env | sort")
#!print
xml_test(alive_url)
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