No longer python2 dependent (there is no python2 on boot nodes yet).

This commit is contained in:
maden
2004-07-26 14:27:13 +00:00
parent 24e10d6916
commit 169ca3b5a9
+8 -30
View File
@@ -1,7 +1,7 @@
#! /usr/bin/env python
#
# $Source: /cvs/G/DRV/misc/App/scripts/call_ioc_ins,v $
# $Revision: 1.5 $ $Date: 2004/07/26 11:39:38 $
# $Revision: 1.6 $ $Date: 2004/07/26 14:27:13 $
'''
Insert boot information about IOCs into the ssrm_public Oracle database.
@@ -38,7 +38,7 @@ def showVersion ():
# ===========
'''
$Source: /cvs/G/DRV/misc/App/scripts/call_ioc_ins,v $
$Revision: 1.5 $ $Date: 2004/07/26 11:39:38 $
$Revision: 1.6 $ $Date: 2004/07/26 14:27:13 $
Installed Location: $SLSBASE/sls/bin
'''
print showVersion.__doc__
@@ -88,31 +88,6 @@ if __name__ == "__main__":
print "\aBad option. Specify \"-h\" for help."
sys.exit (1)
#endtry
#######################################
# Make sure we are running at least python level 2.
# CaChannel seems to give troubles otherwise!
#
if sys.version[0:1] == "1":
if debug:
print "The default python version is", string.split (sys.version)[0]
print "Trying to find a version of python2 ..."
#endif
python2 = commands.getoutput ("type -p python2")
if python2 == "":
print "\n\aThe default python version is", sys.version
print "and this script needs python level 2 or higher."
print " Python level 2 cannot be found."
sys.exit (1)
#endif
if debug: print "Switching to %s ..." % python2
sys.argv.insert (0, python2)
os.execv (python2, sys.argv)
#endif
if sys.version[0:1] == "1":
print "\n\aThe loading of a higher level of python seems to have failed!"
sys.exit (1)
#endif
#######################################
if debug:
print "Time-out = %d secs" % timeout
@@ -123,7 +98,7 @@ if __name__ == "__main__":
#endif
if len (items) != 12:
print "Twelve arguments are needed, not %d" % len (items)
print "\aTwelve arguments are needed, not %d" % len (items)
sys.exit (1)
#endif
@@ -155,7 +130,7 @@ if __name__ == "__main__":
lines = ufo.readlines () # Get the result
ufo.close ()
except:
print "\aError inserting data into database!"
print "Error inserting data into database!"
raise
#endtry
sys.exit (0)
@@ -170,8 +145,8 @@ if __name__ == "__main__":
sys.exit (0)
#endif
#endfor
if debug: print "Timeout."
os.kill (childPID, signal.SIGKILL)
print "Time-out inserting data into database!"
#endif
#endif
@@ -185,6 +160,9 @@ if __name__ == "__main__":
#--------------------------------------------------#
#
# $Log: call_ioc_ins,v $
# Revision 1.6 2004/07/26 14:27:13 maden
# No longer python2 dependent (there is no python2 on boot nodes yet).
#
# Revision 1.5 2004/07/26 11:39:38 maden
# Add time-out
#