Remove etc directory usage in crlcore
This commit is contained in:
parent
887bb3f66c
commit
2c5493c90b
|
@ -218,7 +218,6 @@ def initTechno ( argQuiet ):
|
|||
global techno
|
||||
|
||||
quiet = argQuiet
|
||||
technoFiles = [ sysConfDir+'/techno.conf' ]
|
||||
if os.getenv('HOME'):
|
||||
technoFiles += [ os.getenv('HOME')+'/.coriolis2/techno.py' ]
|
||||
technoFiles += [ os.getcwd()+'/.coriolis2/techno.py' ]
|
||||
|
@ -258,61 +257,12 @@ def setNdaTopDir ( ndaTopDirArg ):
|
|||
sys.path.append( ndaTopDir )
|
||||
return
|
||||
|
||||
|
||||
def staticInitialization ( quiet=True ):
|
||||
global sysConfDir
|
||||
global technoDir
|
||||
global tab
|
||||
global _trace
|
||||
global unitsLambda
|
||||
|
||||
if sysConfDir != None:
|
||||
return
|
||||
reSysConfDir = re.compile(r'.*etc\/coriolis2')
|
||||
if not quiet: print( ' o Locating configuration directory:' )
|
||||
for path in sys.path:
|
||||
if reSysConfDir.match(path):
|
||||
sysConfDir = path
|
||||
if not quiet: print( ' - "{}"'.format( sysConfDir ))
|
||||
break
|
||||
if not sysConfDir:
|
||||
coriolisTop = os.getenv('CORIOLIS_TOP')
|
||||
if coriolisTop == '/usr':
|
||||
sysConfDir = '/etc/coriolis2'
|
||||
elif coriolisTop:
|
||||
sysConfDir = os.path.join(coriolisTop,'etc/coriolis2')
|
||||
else:
|
||||
raise ErrorMessage( 1, [ 'Cannot locate the directoty holding the configuration files.'
|
||||
, 'The path is something ending by <.../etc/coriolis2>.'] )
|
||||
if not quiet: print( ' - "{}"'.format( sysConfDir ))
|
||||
initTechno( quiet )
|
||||
return
|
||||
|
||||
pass
|
||||
|
||||
def setSysConfDir ( quiet=False ):
|
||||
global sysConfDir
|
||||
|
||||
if sysConfDir != None:
|
||||
return
|
||||
reSysConfDir = re.compile(r'.*etc\/coriolis2')
|
||||
if not quiet: print( ' o Locating configuration directory:' )
|
||||
for path in sys.path:
|
||||
if reSysConfDir.match(path):
|
||||
sysConfDir = path
|
||||
if not quiet: print( ' - "{}"'.format( sysConfDir ))
|
||||
break
|
||||
if not sysConfDir:
|
||||
coriolisTop = os.getenv('CORIOLIS_TOP')
|
||||
if coriolisTop == '/usr':
|
||||
sysConfDir = '/etc/coriolis2'
|
||||
elif coriolisTop:
|
||||
sysConfDir = os.path.join(coriolisTop,'etc/coriolis2')
|
||||
else:
|
||||
raise ErrorMessage( 1, [ 'Cannot locate the directoty holding the configuration files.'
|
||||
, 'The path is something ending by <.../etc/coriolis2>.'] )
|
||||
if not quiet: print( ' - "{}"'.format( sysConfDir ))
|
||||
sys.path.append( sysConfDir )
|
||||
return
|
||||
sysConfDir = os.path.split(os.path.dirname(os.path.abspath(__file__)))[0]
|
||||
|
||||
|
||||
def netDirectionToStr ( netDir ):
|
||||
|
|
Loading…
Reference in New Issue