Add more debug output

This commit is contained in:
maden
2004-07-30 13:28:56 +00:00
parent 2f03ef0a75
commit cd40e985d0
+10 -4
View File
@@ -1,7 +1,7 @@
#! /usr/bin/env python #! /usr/bin/env python
# #
# $Source: /cvs/G/DRV/misc/App/scripts/bootinfo,v $ # $Source: /cvs/G/DRV/misc/App/scripts/bootinfo,v $
# $Revision: 1.8 $ $Date: 2004/07/27 07:26:30 $ # $Revision: 1.9 $ $Date: 2004/07/30 13:28:56 $
# #
''' '''
Obtain boot information about IOCs from the ssrm_public Oracle Obtain boot information about IOCs from the ssrm_public Oracle
@@ -44,7 +44,7 @@ def showVersion ():
# =========== # ===========
''' '''
$Source: /cvs/G/DRV/misc/App/scripts/bootinfo,v $ $Source: /cvs/G/DRV/misc/App/scripts/bootinfo,v $
$Revision: 1.8 $ $Date: 2004/07/27 07:26:30 $ $Revision: 1.9 $ $Date: 2004/07/30 13:28:56 $
Installed Location: $SLSBASE/sls/bin Installed Location: $SLSBASE/sls/bin
''' '''
print showVersion.__doc__ print showVersion.__doc__
@@ -57,7 +57,7 @@ if __name__ == "__main__":
sys.stderr = sys.stdout sys.stderr = sys.stdout
caseConvert = 1 caseConvert = 1
debug = 0 debug = 0
timeout = 10 timeout = 15
try: try:
# #
# Analyse the options # Analyse the options
@@ -72,6 +72,7 @@ if __name__ == "__main__":
if opt[0] == "--nocc": caseConvert = 0 if opt[0] == "--nocc": caseConvert = 0
if opt[0] == "--debug": debug = 1 if opt[0] == "--debug": debug = 1
#endfor #endfor
if debug: timeout = 30
except "Help": except "Help":
showUsage () showUsage ()
sys.exit (0) sys.exit (0)
@@ -122,9 +123,10 @@ if __name__ == "__main__":
"IPADDR, " + \ "IPADDR, " + \
"VXWORKS AS ARCH " + \ "VXWORKS AS ARCH " + \
"FROM SSRM.IOC_LASTBOOTED" "FROM SSRM.IOC_LASTBOOTED"
if debug: print "query = \"%s\"" % query
url = "http://pc4860.psi.ch/testplan/IOC_INFOS/ioc_select.php?SQLQUER=" + \ url = "http://pc4860.psi.ch/testplan/IOC_INFOS/ioc_select.php?SQLQUER=" + \
urllib.quote_plus (query) urllib.quote_plus (query)
if debug: print "url = \"%s\"" % url
try: try:
ufo = urllib.urlopen (url) # Query the database ufo = urllib.urlopen (url) # Query the database
lines = ufo.readlines () # Get the result lines = ufo.readlines () # Get the result
@@ -133,6 +135,10 @@ if __name__ == "__main__":
print "\aError getting data from database!" print "\aError getting data from database!"
raise raise
#endtry #endtry
if debug:
print "Response:"
for line in lines: print " \"%s\"" % string.rstrip (line)
#endif
# Loop over the list of patterns. # Loop over the list of patterns.
hdrNotDone = 1 hdrNotDone = 1
for item in items: for item in items: