(file) Return to localize.py CVS log (file) (dir) Up to [Development] / JSOC

Diff for /JSOC/localize.py between version 1.14 and 1.24

version 1.14, 2014/04/17 19:11:05 version 1.24, 2016/04/18 18:14:44
Line 1 
Line 1 
 #!/home/jsoc/bin/linux_x86_64/activepython  #!/usr/bin/python
  
 # When run with the -s flag, localize.py configures the SUMS-server component of NetDRMS. # When run with the -s flag, localize.py configures the SUMS-server component of NetDRMS.
   from __future__ import print_function
 import sys import sys
 import getopt import getopt
 import re import re
Line 11  import filecmp
Line 11  import filecmp
 import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
 from subprocess import check_output, CalledProcessError from subprocess import check_output, CalledProcessError
  
   if sys.version_info < (2, 7):
       raise Exception("You must run the 2.7 release, or a more recent release, of Python.")
   
 # Constants # Constants
 VERS_FILE = 'jsoc_version.h' VERS_FILE = 'jsoc_version.h'
 SDP_CFG = 'configsdp.txt' SDP_CFG = 'configsdp.txt'
Line 74  PERL_FXNS_B = """sub get
Line 77  PERL_FXNS_B = """sub get
 } }
 1;""" 1;"""
  
   PY_BINPATH = '#/usr/bin/python\n'
   
   PY_FXNS_A = """
   class DRMSParams(object):
       def __init__(self):
           self.params = {}
           self.initialize()
   
       def __del__(self):
           del self.params
   
       def initialize(self):
   """
   
   PY_FXNS_B = """    def get(self, name):
           if name in self.params:
               return self.params[name]
           else:
               return None
   """
   
   PY_FXNS_C = """    def getBool(self, name):
           if name in self.params:
               return bool(self.params[name] == '1')
           else:
               return None
   """
   
   
 SUMRM_COMMENT = """# This is the configuration file for the sum_rm program. It was auto-generated by the DRMS master configure script. SUMRM_COMMENT = """# This is the configuration file for the sum_rm program. It was auto-generated by the DRMS master configure script.
 # It controls the behavior of the sum_rm program, and is loaded each time sum_rm runs. To change the # It controls the behavior of the sum_rm program, and is loaded each time sum_rm runs. To change the
 # parameter values in this configuration file, modify config.local, then re-run configure. This configuration # parameter values in this configuration file, modify config.local, then re-run configure. This configuration
Line 220  def createPerlConst(key, val, keyColLen,
Line 252  def createPerlConst(key, val, keyColLen,
         status = bool(0)         status = bool(0)
         return 'use constant ' + key + ' => ' + spaces + val + ';\n'         return 'use constant ' + key + ' => ' + spaces + val + ';\n'
  
   def createPyConst(key, val, keyColLen, status):
       if keyColLen < len(key):
           status = bool(1)
           return None
       else:
           nsp = keyColLen - len(key)
           spaces = str()
           for isp in range(nsp):
               spaces += ' '
           status = bool(0)
           return key + ' = ' + spaces + val + '\n'
   
 def isSupportedPlat(plat): def isSupportedPlat(plat):
     regexp = re.compile(r"\s*(^x86_64|^ia32|^ia64|^avx)", re.IGNORECASE)     regexp = re.compile(r"\s*(^x86_64|^ia32|^ia64|^avx)", re.IGNORECASE)
     matchobj = regexp.match(plat);     matchobj = regexp.match(plat);
Line 255  def processMakeParam(mDefs, key, val, pl
Line 299  def processMakeParam(mDefs, key, val, pl
                 machDict[varMach] = {}                 machDict[varMach] = {}
             machDict[varMach][varName] = varValu             machDict[varMach][varName] = varValu
  
 def processParam(cfgfile, line, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, platDict, machDict, section):  def processParam(cfgfile, line, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, pyConstSection, pyInitSection, platDict, machDict, section):
     status = 0     status = 0
  
     if ''.join(section) == 'defs' or not cfgfile:     if ''.join(section) == 'defs' or not cfgfile:
Line 314  def processParam(cfgfile, line, regexpQu
Line 358  def processParam(cfgfile, line, regexpQu
                 # Save const info to a string                 # Save const info to a string
                 perlConstSection.extend(list(createPerlConst(key, "'" + val + "'", 40, status)))                 perlConstSection.extend(list(createPerlConst(key, "'" + val + "'", 40, status)))
  
                   # Python file
                   pyConstSection.extend(list(createPyConst(key, "'" + val + "'", 40, status)))
   
                 if status:                 if status:
                     raise Exception('paramNameTooLong', key)                     raise Exception('paramNameTooLong', key)
  
Line 322  def processParam(cfgfile, line, regexpQu
Line 369  def processParam(cfgfile, line, regexpQu
                 # we can refer to those in the init section. The key variable holds the                 # we can refer to those in the init section. The key variable holds the
                 # name of the constant.                 # name of the constant.
                 perlInitSection.extend(list("\n  $self->{_paramsH}->{'" + key + "'} = " + key + ';'))                 perlInitSection.extend(list("\n  $self->{_paramsH}->{'" + key + "'} = " + key + ';'))
   
                   # The amount of indenting matters! This is Python.
                   pyInitSection.extend(list("        self.params['" + key + "'] = " + key + '\n'))
             else:             else:
                 # No quote qualifier                 # No quote qualifier
                 raise Exception('missingQuoteQual', key)                 raise Exception('missingQuoteQual', key)
Line 415  def determineSection(line, regexpDefs, r
Line 465  def determineSection(line, regexpDefs, r
 # projMkRules is the list containing the make_basic.mk content. # projMkRules is the list containing the make_basic.mk content.
 # projRules is the list containing the Rules.mk content. # projRules is the list containing the Rules.mk content.
 # projTargert is the list containing the target.mk content. # projTargert is the list containing the target.mk content.
 def parseConfig(fin, keymap, addenda, defs, cDefs, mDefsGen, mDefsMake, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection):  def parseConfig(fin, keymap, addenda, defs, cDefs, mDefsGen, mDefsMake, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection, pyConstSection, pyInitSection):
     rv = bool(0)     rv = bool(0)
  
     # Open required config file (config.local)     # Open required config file (config.local)
Line 476  def parseConfig(fin, keymap, addenda, de
Line 526  def parseConfig(fin, keymap, addenda, de
                     # Intentional fall through to next if statement                     # Intentional fall through to next if statement
                 if section == 'defs' or section == 'make':                 if section == 'defs' or section == 'make':
                     iscfg = bool(1)                     iscfg = bool(1)
                     ppRet = processParam(iscfg, line, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, platDict, machDict, section)                      ppRet = processParam(iscfg, line, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, pyConstSection, pyInitSection, platDict, machDict, section)
  
                     if ppRet:                     if ppRet:
                         break                         break
Line 506  def parseConfig(fin, keymap, addenda, de
Line 556  def parseConfig(fin, keymap, addenda, de
                     # Must parse xml and use the project-specific information to populate the Rules.mk and target.mk files.                     # Must parse xml and use the project-specific information to populate the Rules.mk and target.mk files.
                     # Collect all xml lines for now, then process after file-read loop.                     # Collect all xml lines for now, then process after file-read loop.
                     if xml is None:                     if xml is None:
                         xml = line                          # The first time through this section, line is the config.local div, __PROJ__. Discard that.
                           xml = ''
                           continue
                     else:                     else:
                         xml += line                         xml += line
                 else:                 else:
                     # Unknown section                     # Unknown section
                     raise Exception('unknownSection', section)                     raise Exception('unknownSection', section)
     except Exception as exc:     except Exception as exc:
           if len(exc.args) >= 2:
         msg = exc.args[0]         msg = exc.args[0]
           else:
               # re-raise the exception
               raise
         if msg == 'badKeyMapKey':         if msg == 'badKeyMapKey':
             # If we are here, then there was a non-empty keymap, and the parameter came from             # If we are here, then there was a non-empty keymap, and the parameter came from
             # the configuration file.             # the configuration file.
             violator = exc.args[1]             violator = exc.args[1]
             print('Unknown parameter name ' + "'" + violator + "'" + ' in ' + cfgfile + '.', file=sys.stderr)              print('Unknown parameter name ' + "'" + violator + "'" + ' in ' + fin.name + '.', file=sys.stderr)
             rv = bool(1)             rv = bool(1)
         elif msg == 'badQuoteQual':         elif msg == 'badQuoteQual':
             # The bad quote qualifier came from the configuration file, not the addenda, since             # The bad quote qualifier came from the configuration file, not the addenda, since
             # we will have fixed any bad qualifiers in the addenda (which is populated by code).             # we will have fixed any bad qualifiers in the addenda (which is populated by code).
             violator = exc.args[1]             violator = exc.args[1]
             print('Unknown quote qualifier ' + "'" + violator + "'" + ' in ' + cfgfile + '.', file=sys.stderr)              print('Unknown quote qualifier ' + "'" + violator + "'" + ' in ' + fin.name + '.', file=sys.stderr)
             rv = bool(1)             rv = bool(1)
         elif msg == 'missingQuoteQual':         elif msg == 'missingQuoteQual':
             violator = exc.args[1]             violator = exc.args[1]
             print('Missing quote qualifier for parameter ' + "'" + violator + "'" + ' in ' + cfgfile + '.', file=sys.stderr)              print('Missing quote qualifier for parameter ' + "'" + violator + "'" + ' in ' + fin.name + '.', file=sys.stderr)
             rv = bool(1)             rv = bool(1)
         elif msg == 'paramNameTooLong':         elif msg == 'paramNameTooLong':
             violator = exc.args[1]             violator = exc.args[1]
Line 556  def parseConfig(fin, keymap, addenda, de
Line 612  def parseConfig(fin, keymap, addenda, de
         iscfg = bool(0)         iscfg = bool(0)
         for key in addenda:         for key in addenda:
             item = key + ' ' + addenda[key]             item = key + ' ' + addenda[key]
             ppRet = processParam(iscfg, item, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, platDict, machDict, 'defs')              ppRet = processParam(iscfg, item, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, pyConstSection, pyInitSection, platDict, machDict, 'defs')
             if ppRet:             if ppRet:
                 break;                 break;
  
Line 636  def configureComps(defs, mDefs):
Line 692  def configureComps(defs, mDefs):
  
         # Try gcc.         # Try gcc.
         if not hasicc:         if not hasicc:
               rv = bool(0)
             cmd = 'gcc -v 2>&1'             cmd = 'gcc -v 2>&1'
             try:             try:
                 ret = check_output(cmd, shell=True)                 ret = check_output(cmd, shell=True)
Line 644  def configureComps(defs, mDefs):
Line 701  def configureComps(defs, mDefs):
                 print('Command ' + "'" + cmd + "'" + ' ran improperly.')                 print('Command ' + "'" + cmd + "'" + ' ran improperly.')
                 rv = bool(1)                 rv = bool(1)
  
             if rv == bool(0):              if not rv:
                 regexp = re.compile(r".+gcc\s+version\s+(\d+)\.(\d+)", re.DOTALL)                 regexp = re.compile(r".+gcc\s+version\s+(\d+)\.(\d+)", re.DOTALL)
                 matchobj = regexp.match(ret)                 matchobj = regexp.match(ret)
                 if matchobj is None:                 if matchobj is None:
Line 656  def configureComps(defs, mDefs):
Line 713  def configureComps(defs, mDefs):
                         hasgcc = bool(1)                         hasgcc = bool(1)
  
         # Try ifort.         # Try ifort.
           rv = bool(0)
         cmd = 'ifort --version 2>&1'         cmd = 'ifort --version 2>&1'
         try:         try:
             ret = check_output(cmd, shell=True)             ret = check_output(cmd, shell=True)
Line 677  def configureComps(defs, mDefs):
Line 735  def configureComps(defs, mDefs):
  
         # Try gfortran         # Try gfortran
         if not hasifort:         if not hasifort:
               rv = bool(0)
             cmd = 'gfortran -v 2>&1'             cmd = 'gfortran -v 2>&1'
             try:             try:
                 ret = check_output(cmd, shell=True)                 ret = check_output(cmd, shell=True)
Line 685  def configureComps(defs, mDefs):
Line 744  def configureComps(defs, mDefs):
                 print('Command ' + "'" + cmd + "'" + ' ran improperly.')                 print('Command ' + "'" + cmd + "'" + ' ran improperly.')
                 rv = bool(1)                 rv = bool(1)
  
             if rv == bool(0):              if not rv:
                 regexp = re.compile(r".+gcc\s+version\s+(\d+)\.(\d+)", re.DOTALL)                 regexp = re.compile(r".+gcc\s+version\s+(\d+)\.(\d+)", re.DOTALL)
                 matchobj = regexp.match(ret)                 matchobj = regexp.match(ret)
                 if matchobj is None:                 if matchobj is None:
Line 697  def configureComps(defs, mDefs):
Line 756  def configureComps(defs, mDefs):
                         hasgfort = bool(1)                         hasgfort = bool(1)
  
         # Append the compiler make variables to the make file         # Append the compiler make variables to the make file
           rv = bool(0)
   
         if not hasicc and not hasgcc:         if not hasicc and not hasgcc:
             print('Fatal error: Acceptable C compiler not found! You will be unable to build the DRMS library.', file=sys.stderr)             print('Fatal error: Acceptable C compiler not found! You will be unable to build the DRMS library.', file=sys.stderr)
             rv = bool(1)             rv = bool(1)
Line 718  def configureComps(defs, mDefs):
Line 779  def configureComps(defs, mDefs):
  
     return rv     return rv
  
 def writeParamsFiles(base, cfile, mfile, pfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection):  def writeParamsFiles(base, cfile, mfile, pfile, pyfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection, pyConstSection, pyInitSection):
     rv = bool(0)     rv = bool(0)
  
     # Merge mDefsGen, mDefsMake, and mDefsComps into a single string with compiler configuration first, general parameters next, then     # Merge mDefsGen, mDefsMake, and mDefsComps into a single string with compiler configuration first, general parameters next, then
Line 726  def writeParamsFiles(base, cfile, mfile,
Line 787  def writeParamsFiles(base, cfile, mfile,
     mDefs = '\n# Compiler Selection\n' + ''.join(mDefsComps) + '\n\n# General Parameters\n' + ''.join(mDefsGen) + '\n\n# Parameters to Configure make\n' + ''.join(mDefsMake)     mDefs = '\n# Compiler Selection\n' + ''.join(mDefsComps) + '\n\n# General Parameters\n' + ''.join(mDefsGen) + '\n\n# Parameters to Configure make\n' + ''.join(mDefsMake)
  
     try:     try:
         with open(cfile, 'w') as cout, open(mfile, 'w') as mout, open(pfile, 'w') as pout:          with open(cfile, 'w') as cout, open(mfile, 'w') as mout, open(pfile, 'w') as pout, open(pyfile, 'w') as pyout:
             # C file of macros             # C file of macros
             print(C_PREFIX, file=cout)             print(C_PREFIX, file=cout)
             print('/* This file contains a set of preprocessor macros - one for each configuration parameter. */\n', file=cout)             print('/* This file contains a set of preprocessor macros - one for each configuration parameter. */\n', file=cout)
Line 755  def writeParamsFiles(base, cfile, mfile,
Line 816  def writeParamsFiles(base, cfile, mfile,
             print(''.join(perlInitSection), file=pout)             print(''.join(perlInitSection), file=pout)
             print('}\n', file=pout)             print('}\n', file=pout)
             print(PERL_FXNS_B, file=pout)             print(PERL_FXNS_B, file=pout)
   
               # Python module
               print(PY_BINPATH, file=pyout)
               print(PREFIX, file=pyout)
               print('# This file contains a set of constants - one for each configuration parameter.\n', file=pyout)
               print(''.join(pyConstSection), file=pyout)
               print(PY_FXNS_A, file=pyout, end='')
               print(''.join(pyInitSection), file=pyout)
               print(PY_FXNS_B, file=pyout)
               print(PY_FXNS_C, file=pyout)
   
     except IOError as exc:     except IOError as exc:
         type, value, traceback = sys.exc_info()         type, value, traceback = sys.exc_info()
         print(exc.strerror, file=sys.stderr)         print(exc.strerror, file=sys.stderr)
Line 917  def generateSumRmCfg(defs):
Line 989  def generateSumRmCfg(defs):
  
     return rv     return rv
  
 def configureNet(cfgfile, cfile, mfile, pfile, pCfile, pMfile, pRfile, pTfile, base, keymap, createSumRmCfg):  def configureNet(cfgfile, cfile, mfile, pfile, pyfile, pCfile, pMfile, pRfile, pTfile, base, keymap, createSumRmCfg):
     rv = bool(0)     rv = bool(0)
  
     defs = {}     defs = {}
Line 931  def configureNet(cfgfile, cfile, mfile,
Line 1003  def configureNet(cfgfile, cfile, mfile,
     projTarget = list()     projTarget = list()
     perlConstSection = list()     perlConstSection = list()
     perlInitSection = list()     perlInitSection = list()
       pyConstSection = list()
       pyInitSection = list()
     addenda = {}     addenda = {}
  
     # There are three parameters that were not included in the original config.local parameter set, for some reason.     # There are three parameters that were not included in the original config.local parameter set, for some reason.
Line 948  def configureNet(cfgfile, cfile, mfile,
Line 1022  def configureNet(cfgfile, cfile, mfile,
     try:     try:
         with open(cfgfile, 'r') as fin:         with open(cfgfile, 'r') as fin:
             # Process configuration parameters             # Process configuration parameters
             rv = parseConfig(fin, keymap, addenda, defs, cDefs, mDefsGen, mDefsMake, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection)              rv = parseConfig(fin, keymap, addenda, defs, cDefs, mDefsGen, mDefsMake, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection, pyConstSection, pyInitSection)
             if not rv:             if not rv:
                 # Must add a parameter for the SUMS_MANAGER UID (for some reason). This must be done after the                 # Must add a parameter for the SUMS_MANAGER UID (for some reason). This must be done after the
                 # config file is processed since an input to getMgrUIDLine() is one of the config file's                 # config file is processed since an input to getMgrUIDLine() is one of the config file's
Line 956  def configureNet(cfgfile, cfile, mfile,
Line 1030  def configureNet(cfgfile, cfile, mfile,
                 uidParam = {}                 uidParam = {}
                 rv = getMgrUIDLine(defs, uidParam)                 rv = getMgrUIDLine(defs, uidParam)
                 if rv == bool(0):                 if rv == bool(0):
                     rv = parseConfig(None, keymap, uidParam, defs, cDefs, mDefsGen, None, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection)                      rv = parseConfig(None, keymap, uidParam, defs, cDefs, mDefsGen, None, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection, pyConstSection, pyInitSection)
             # Configure the compiler-selection make variables.             # Configure the compiler-selection make variables.
             if not rv:             if not rv:
                 rv = configureComps(defs, mDefsComps)                 rv = configureComps(defs, mDefsComps)
  
             # Write out the parameter files.             # Write out the parameter files.
             if not rv:             if not rv:
                 rv = writeParamsFiles(base, cfile, mfile, pfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection)                  rv = writeParamsFiles(base, cfile, mfile, pfile, pyfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection, pyConstSection, pyInitSection)
  
             # Write out the project-specific make files (make_basic.mk, Rules.mk, and target.mk).             # Write out the project-specific make files (make_basic.mk, Rules.mk, and target.mk).
             if not rv:             if not rv:
Line 976  def configureNet(cfgfile, cfile, mfile,
Line 1050  def configureNet(cfgfile, cfile, mfile,
         print(exc.strerror, file=sys.stderr)         print(exc.strerror, file=sys.stderr)
         print('Unable to read configuration file ' + cfgfile + '.', file=sys.stderr)         print('Unable to read configuration file ' + cfgfile + '.', file=sys.stderr)
     except Exception as exc:     except Exception as exc:
         if len(exc.args >= 2):          if len(exc.args) >= 2:
             type, msg = exc.args             type, msg = exc.args
         else:         else:
             # re-raise the exception             # re-raise the exception
Line 1000  def configureNet(cfgfile, cfile, mfile,
Line 1074  def configureNet(cfgfile, cfile, mfile,
  
     return rv     return rv
  
 def configureSdp(cfgfile, cfile, mfile, pfile, pCfile, pMfile, pRfile, pTfile, base):  def configureSdp(cfgfile, cfile, mfile, pfile, pyfile, pCfile, pMfile, pRfile, pTfile, base):
     rv = bool(0)     rv = bool(0)
  
     defs = {}     defs = {}
Line 1014  def configureSdp(cfgfile, cfile, mfile,
Line 1088  def configureSdp(cfgfile, cfile, mfile,
     mDefsComps = list()     mDefsComps = list()
     perlConstSection = list()     perlConstSection = list()
     perlInitSection = list()     perlInitSection = list()
       pyConstSection = list()
       pyInitSection = list()
   
     addenda = {}     addenda = {}
  
     # There are three parameters that were not included in the original config.local parameter set, for some reason.     # There are three parameters that were not included in the original config.local parameter set, for some reason.
Line 1027  def configureSdp(cfgfile, cfile, mfile,
Line 1104  def configureSdp(cfgfile, cfile, mfile,
  
     try:     try:
         with open(cfgfile, 'r') as fin:         with open(cfgfile, 'r') as fin:
             rv = parseConfig(fin, None, addenda, defs, cDefs, mDefsGen, mDefsMake, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection)              rv = parseConfig(fin, None, addenda, defs, cDefs, mDefsGen, mDefsMake, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection, pyConstSection, pyInitSection)
  
             if not rv:             if not rv:
                 # Must add a parameter for the SUMS_MANAGER UID (for some reason)                 # Must add a parameter for the SUMS_MANAGER UID (for some reason)
                 uidParam = {}                 uidParam = {}
                 rv = getMgrUIDLine(defs, uidParam)                 rv = getMgrUIDLine(defs, uidParam)
                 if not rv:                 if not rv:
                     rv = parseConfig(None, None, uidParam, defs, cDefs, mDefsGen, None, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection)                      rv = parseConfig(None, None, uidParam, defs, cDefs, mDefsGen, None, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection, pyConstSection, pyInitSection)
  
                 # Configure the compiler-selection make variables.                 # Configure the compiler-selection make variables.
                 if not rv:                 if not rv:
Line 1042  def configureSdp(cfgfile, cfile, mfile,
Line 1119  def configureSdp(cfgfile, cfile, mfile,
  
                 # Write out the parameter files.                 # Write out the parameter files.
                 if not rv:                 if not rv:
                     rv = writeParamsFiles(base, cfile, mfile, pfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection)                      rv = writeParamsFiles(base, cfile, mfile, pfile, pyfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection, pyConstSection, pyInitSection)
  
                 # Write out the project-specific make files (make_basic.mk, Rules.mk, and target.mk).                 # Write out the project-specific make files (make_basic.mk, Rules.mk, and target.mk).
                 if not rv:                 if not rv:
Line 1054  def configureSdp(cfgfile, cfile, mfile,
Line 1131  def configureSdp(cfgfile, cfile, mfile,
         print(exc.strerror, file=sys.stderr)         print(exc.strerror, file=sys.stderr)
         print('Unable to read configuration file ' + cfgfile + '.', file=sys.stderr)         print('Unable to read configuration file ' + cfgfile + '.', file=sys.stderr)
     except Exception as exc:     except Exception as exc:
           if len(exc.args) >= 2:
         type = exc.args[0]         type = exc.args[0]
           else:
               # re-raise the exception
               raise
   
         if type == 'unexpectedIccRet':         if type == 'unexpectedIccRet':
             msg = exc.args[1]             msg = exc.args[1]
             print('icc -V returned this unexpected message:\n' + msg, file=sys.stderr)             print('icc -V returned this unexpected message:\n' + msg, file=sys.stderr)
Line 1103  if rv == RET_SUCCESS:
Line 1185  if rv == RET_SUCCESS:
     cfile = optD['dir'] + '/' + optD['base'] + '.h'     cfile = optD['dir'] + '/' + optD['base'] + '.h'
     mfile = optD['dir'] + '/' + optD['base'] + '.mk'     mfile = optD['dir'] + '/' + optD['base'] + '.mk'
     pfile = optD['dir'] + '/' + optD['base'] + '.pm'     pfile = optD['dir'] + '/' + optD['base'] + '.pm'
       pyfile = optD['dir'] + '/' + optD['base'] + '.py'
     pCfile = optD['dir'] + '/configure'     pCfile = optD['dir'] + '/configure'
     pMfile = optD['dir'] + '/make_basic.mk'     pMfile = optD['dir'] + '/make_basic.mk'
     pRfile = optD['dir'] + '/Rules.mk'     pRfile = optD['dir'] + '/Rules.mk'
Line 1133  if rv == RET_SUCCESS:
Line 1216  if rv == RET_SUCCESS:
  
         # We also need to set the UID of the SUMS manager. We have the name of the         # We also need to set the UID of the SUMS manager. We have the name of the
         # SUMS manager (it is in the configuration file)         # SUMS manager (it is in the configuration file)
         configureNet(NET_CFG, cfile, mfile, pfile, pCfile, pMfile, pRfile, pTfile, optD['base'], keymap, 'server' in optD)          configureNet(NET_CFG, cfile, mfile, pfile, pyfile, pCfile, pMfile, pRfile, pTfile, optD['base'], keymap, 'server' in optD)
     else:     else:
         # A Stanford user can override the parameters in configsdp.txt by copying that file to config.local,         # A Stanford user can override the parameters in configsdp.txt by copying that file to config.local,
         # and then editing config.local. So, if config.local exists, use that.         # and then editing config.local. So, if config.local exists, use that.
         if os.path.isfile(cdir + '/' + NET_CFG):         if os.path.isfile(cdir + '/' + NET_CFG):
             configureSdp(NET_CFG, cfile, mfile, pfile, pCfile, pMfile, pRfile, pTfile, optD['base'])              configureSdp(NET_CFG, cfile, mfile, pfile, pyfile, pCfile, pMfile, pRfile, pTfile, optD['base'])
         else:         else:
             configureSdp(SDP_CFG, cfile, mfile, pfile, pCfile, pMfile, pRfile, pTfile, optD['base'])              configureSdp(SDP_CFG, cfile, mfile, pfile, pyfile, pCfile, pMfile, pRfile, pTfile, optD['base'])


Legend:
Removed from v.1.14  
changed lines
  Added in v.1.24

Karen Tian
Powered by
ViewCVS 0.9.4