Commit f00719f8 authored by kpetersn's avatar kpetersn
Browse files

Added, a script to troubleshoot why stopped working when called from cron on OS X.

parent d57cfe10
#!/usr/bin/env python
import urllib
import xml.etree.ElementTree as ET
import os
alive_url = ""
# function for troubleshooting
def get_xml(alive_url):
# Get the xml file
print "Opening URL"
f = urllib.urlopen(alive_url)
print "Reading XML from URL"
xml_string =
except IOError:
print "Couldn't open URL"
xml_string = None
print "Closing URL"
return xml_string
def open_xml(xml_string):
root = ET.fromstring(xml_string)
except ET.ParseError:
print "Invalid XML file"
retval = xml_string
print "XML file OK"
retval = "OK"
#!retval = xml_string
return retval
def xml_test(alive_url):
xml_string = get_xml(alive_url)
if xml_string != None:
print open_xml(xml_string)
print "uid = %i, gid = %i" % (os.getuid(), os.getgid())
Supports Markdown
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