version 1.14, 2014/04/17 19:11:05
|
version 1.17, 2014/04/18 19:14:54
|
|
|
#!/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 513 def parseConfig(fin, keymap, addenda, de |
|
Line 513 def parseConfig(fin, keymap, addenda, de |
|
# 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 976 def configureNet(cfgfile, cfile, mfile, |
|
Line 980 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 1054 def configureSdp(cfgfile, cfile, mfile, |
|
Line 1058 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) |