Changeset 631 for branches


Ignore:
Timestamp:
Oct 17, 2007 12:56:13 PM (12 years ago)
Author:
jpfasano
Message:

userConfig now has svn path for math01 machine
osCommand now has alternate implementation for older versions of python

Location:
branches/testScripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBosCommand.py

    r629 r631  
    11#! /usr/bin/env python
    22
    3 import subprocess
     3from socket import gethostname
    44
    55#------------------------------------------------------------------------
     
    99#------------------------------------------------------------------------
    1010def run(cmd) :
    11   p=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
    12   cmdStdout,cmdStderr=p.communicate()
    13   cmdRc=p.returncode
    14   retVal = { 'returnCode':cmdRc, 'stdout':cmdStdout, 'stderr':cmdStderr }
    15   return retVal
     11
     12  if gethostname()=='math01.watson.ibm.com' :
     13
     14    # this machine has a back level of python, so must use an older
     15    # techniques to implement this function.  This implementation
     16    # runs the command in the same process as the script.
     17    # This has the problem that if the command crashes, it will bring
     18    # down the script. Another problem is that stderr and stdout are
     19    # mingled together
     20
     21    import commands
     22    result = commands.getstatusoutput(cmd)
     23    retVal = { 'returnCode':result[0], 'stdout':result[1], 'stderr':'' }
     24    return retVal
     25
     26  else :
     27
     28    import subprocess
     29 
     30    p=subprocess.Popen(cmd,shell=True,\
     31                       stdout=subprocess.PIPE,\
     32                       stderr=subprocess.PIPE)
     33    cmdStdout,cmdStderr=p.communicate()
     34    cmdRc=p.returncode
     35    retVal = { 'returnCode':cmdRc, 'stdout':cmdStdout, 'stderr':cmdStderr }
     36    return retVal
    1637
    1738
  • branches/testScripts/NBuserConfig.py

    r630 r631  
    1919elif gethostname()=='math01.watson.ibm.com' :
    2020  NIGHTLY_BUILD_ROOT_DIR = '/u/jpfasano/COIN/nbTest'
     21elif gethostname()=='kmartin-maclt.local' :
     22  NIGHTLY_BUILD_ROOT_DIR = '/Users/kmartin/COIN'
    2123else :
    22   NIGHTLY_BUILD_ROOT_DIR = '/Users/kmartin/COIN'
     24  NIGHTLY_BUILD_ROOT_DIR = 'xxx'
    2325
    24 SVNPATH_PREFIX=''
    25  
     26#----------------------------------------------------------------------
     27# Define directory where svn is located.
     28# If svn is in the default path, then this can be set to an empty string
     29#----------------------------------------------------------------------
     30if gethostname()=='math01.watson.ibm.com' :
     31  SVNPATH_PREFIX='/gsa/yktgsa/projects/o/oslos/local/bin'
     32elif gethostname()=='kmartin-maclt.local' :
     33  SVNPATH_PREFIX='/usr/local/bin/'
     34else :
     35  SVNPATH_PREFIX=''
     36
    2637
    2738#----------------------------------------------------------------------
     
    6374  MY_EMAIL_ADDR='jpfasano _AT_ us _DOT_ ibm _DOT_ com'
    6475  SEND_MAIL_TO_PROJECT_MANAGER=0
    65 else :
     76elif gethostname()=='kmartin-maclt.local' :
    6677  SMTP_SERVER_NAME = 'gsbims.uchicago.edu'
    6778  SMTP_SERVER_PORT =587
     
    7384  MY_EMAIL_ADDR='kipp _DOT_ martin _AT_ chicagogsb _DOT_ edu'
    7485  SEND_MAIL_TO_PROJECT_MANAGER=0
    75   SVNPATH_PREFIX='/usr/local/bin/'
     86else :
     87  SMTP_SERVER_NAME = 'xxx.smtp.server.name'
     88  SMTP_SERVER_PORT =25
     89  SMTP_SSL_SERVER = 0
     90  SMTP_USER_NAME = 'xxxx'
     91  SMTP_PASSWORD_FILENAME = '/xxx/yyy/smtpPassWordFile'
     92
     93  SENDER_EMAIL_ADDR='xxx _AT_ yyyy _DOT_ edu'
     94  MY_EMAIL_ADDR='xxx _AT_ yyyy _DOT_ edu'
     95  SEND_MAIL_TO_PROJECT_MANAGER=0
    7696
    7797
Note: See TracChangeset for help on using the changeset viewer.