More accurate error message in Python module importation.
This commit is contained in:
parent
c26a36db88
commit
f85159bdb4
|
@ -191,10 +191,11 @@ if __name__ == "__main__":
|
||||||
else:
|
else:
|
||||||
sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version)
|
sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version)
|
||||||
|
|
||||||
strippedPythonPath = "%s:" % (sitePackagesDir) + strippedPythonPath
|
strippedPythonPath = "%s:" % (sitePackagesDir) + strippedPythonPath
|
||||||
strippedPythonPath = "%s/crlcore:" % (sitePackagesDir) + strippedPythonPath
|
strippedPythonPath = "%s/crlcore:" % (sitePackagesDir) + strippedPythonPath
|
||||||
strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath
|
strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath
|
||||||
strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath
|
strippedPythonPath = "%s/cumulus/plugins:" % (sitePackagesDir) + strippedPythonPath
|
||||||
|
strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath
|
||||||
|
|
||||||
shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";\n' \
|
shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";\n' \
|
||||||
'export PYTHONPATH;\n'
|
'export PYTHONPATH;\n'
|
||||||
|
|
|
@ -34,10 +34,16 @@ try:
|
||||||
from helpers import Alliance
|
from helpers import Alliance
|
||||||
import helpers.Display
|
import helpers.Display
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
|
|
@ -58,10 +58,16 @@ try:
|
||||||
import chip.BlockCorona
|
import chip.BlockCorona
|
||||||
import chip.PadsCorona
|
import chip.PadsCorona
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
@ -162,6 +168,7 @@ def unicornHook ( **kw ):
|
||||||
|
|
||||||
|
|
||||||
def ScriptMain ( **kw ):
|
def ScriptMain ( **kw ):
|
||||||
|
rvalue = True
|
||||||
try:
|
try:
|
||||||
helpers.staticInitialization( quiet=True )
|
helpers.staticInitialization( quiet=True )
|
||||||
#helpers.setTraceLevel( 550 )
|
#helpers.setTraceLevel( 550 )
|
||||||
|
@ -198,11 +205,13 @@ def ScriptMain ( **kw ):
|
||||||
except ErrorMessage, e:
|
except ErrorMessage, e:
|
||||||
print e; errorCode = e.code
|
print e; errorCode = e.code
|
||||||
if editor: editor.fit()
|
if editor: editor.fit()
|
||||||
|
rvalue = False
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '\n\n', e; errorCode = 1
|
print '\n\n', e; errorCode = 1
|
||||||
traceback.print_tb(sys.exc_info()[2])
|
traceback.print_tb(sys.exc_info()[2])
|
||||||
|
rvalue = False
|
||||||
|
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
|
|
||||||
return 0
|
return rvalue
|
||||||
|
|
|
@ -32,10 +32,16 @@ try:
|
||||||
import clocktree.ClockTree
|
import clocktree.ClockTree
|
||||||
import chip.Configuration
|
import chip.Configuration
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
|
|
@ -56,10 +56,16 @@ try:
|
||||||
from chip.Configuration import destroyNetComponents
|
from chip.Configuration import destroyNetComponents
|
||||||
from chip.Configuration import GaugeConfWrapper
|
from chip.Configuration import GaugeConfWrapper
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
|
|
@ -38,10 +38,16 @@ try:
|
||||||
from helpers import ErrorMessage
|
from helpers import ErrorMessage
|
||||||
import plugins
|
import plugins
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
|
|
@ -23,10 +23,16 @@ try:
|
||||||
import Unicorn
|
import Unicorn
|
||||||
import placeandroute
|
import placeandroute
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
|
|
@ -7,10 +7,16 @@ try:
|
||||||
from helpers import WarningMessage
|
from helpers import WarningMessage
|
||||||
import Viewer
|
import Viewer
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
|
|
@ -16,10 +16,16 @@ try:
|
||||||
import Kite
|
import Kite
|
||||||
import Unicorn
|
import Unicorn
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
|
|
@ -22,10 +22,16 @@ try:
|
||||||
from helpers import WarningMessage
|
from helpers import WarningMessage
|
||||||
import Viewer
|
import Viewer
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
module = str(e).split()[-1]
|
serror = str(e)
|
||||||
|
if serror.startswith('No module named'):
|
||||||
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
module = serror.split()[-1]
|
||||||
print ' Please check the integrity of the <coriolis> package.'
|
print '[ERROR] The <%s> python module or symbol cannot be loaded.' % module
|
||||||
|
print ' Please check the integrity of the <coriolis> package.'
|
||||||
|
if str(e).find('cannot open shared object file'):
|
||||||
|
library = serror.split(':')[0]
|
||||||
|
print '[ERROR] The <%s> shared library cannot be loaded.' % library
|
||||||
|
print ' Under RHEL 6, you must be under devtoolset-2.'
|
||||||
|
print ' (scl enable devtoolset-2 bash)'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
print '[ERROR] A strange exception occurred while loading the basic Coriolis/Python'
|
||||||
|
|
Loading…
Reference in New Issue