From 298016ab82b12ec64f78f077868311680507dd5a Mon Sep 17 00:00:00 2001
From: Kevin Peterson <kmpeters@anl.gov>
Date: Thu, 26 Jun 2014 15:42:17 -0500
Subject: [PATCH] Modified test.py to use curl instead of python for grabbing
 the xml. Seems to fix the problem.

---
 test.py | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/test.py b/test.py
index 3a0770c..58ec409 100755
--- a/test.py
+++ b/test.py
@@ -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)
-- 
GitLab