Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,9 @@ import os ...@@ -6,6 +6,9 @@ import os
alive_url = "http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi" alive_url = "http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi"
#!os.setgid(104)
#!os.setegid(104)
# function for troubleshooting # function for troubleshooting
def get_xml(alive_url): def get_xml(alive_url):
# Get the xml file # Get the xml file
...@@ -22,6 +25,15 @@ def get_xml(alive_url): ...@@ -22,6 +25,15 @@ def get_xml(alive_url):
f.close() f.close()
return xml_string 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): def open_xml(xml_string):
try: try:
root = ET.fromstring(xml_string) root = ET.fromstring(xml_string)
...@@ -35,9 +47,14 @@ def open_xml(xml_string): ...@@ -35,9 +47,14 @@ def open_xml(xml_string):
return retval return retval
def xml_test(alive_url): 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: if xml_string != None:
print open_xml(xml_string) print open_xml(xml_string)
print "uid = %i, gid = %i" % (os.getuid(), os.getgid()) 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) xml_test(alive_url)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment