~christopher-hunt08/maus/maus_integrated_kalman

« back to all changes in this revision

Viewing changes to src/common_py/Go.py

  • Committer: Durga Rajaram
  • Date: 2014-07-16 15:13:05 UTC
  • mfrom: (659.1.92 cand)
  • Revision ID: durga@fnal.gov-20140716151305-q27rv1y9p03v9lks
Tags: MAUS-v0.9, MAUS-v0.9.0
MAUS-v0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
        bzr_dir = os.path.expandvars('$MAUS_ROOT_DIR/.bzr/branch/')
189
189
        bzr_configuration = 'bzr configuration not found'
190
190
        bzr_revision = 'bzr revision not found'
191
 
        bzr_status = 'bzr executable not found'
192
 
        try:
193
 
            bzr_conf_file = open(os.path.join(bzr_dir, 'branch.conf'))
194
 
            bzr_configuration = bzr_conf_file.read()
195
 
        except (OSError, IOError):
196
 
            pass
197
 
        try:
198
 
            bzr_rev_file = open(os.path.join(bzr_dir, 'last-revision'))
199
 
            bzr_revision = bzr_rev_file.read()
200
 
        except (OSError, IOError):
201
 
            pass
202
 
        try:
203
 
            mrd = os.environ["MAUS_ROOT_DIR"]
204
 
            bzr_status = subprocess.check_output(['bzr', 'status', mrd],
 
191
        bzr_status = 'bzr status not found'
 
192
        bzr_source = True
 
193
        if not os.path.isdir(bzr_dir):
 
194
            bzr_source = False 
 
195
        if bzr_source:
 
196
            try:
 
197
                bzr_conf_file = open(os.path.join(bzr_dir, 'branch.conf'))
 
198
                bzr_configuration = bzr_conf_file.read()
 
199
            except (OSError, IOError):
 
200
                pass
 
201
            try:
 
202
                bzr_rev_file = open(os.path.join(bzr_dir, 'last-revision'))
 
203
                bzr_revision = bzr_rev_file.read()
 
204
            except (OSError, IOError):
 
205
                pass
 
206
            try:
 
207
                mrd = os.environ["MAUS_ROOT_DIR"]
 
208
                bzr_status = subprocess.check_output(['bzr', 'status', mrd],
205
209
                                                 stderr=subprocess.STDOUT)
206
 
        except (OSError, IOError):
207
 
            pass
 
210
            except (OSError, IOError, subprocess.CalledProcessError):
 
211
                pass
208
212
        maus_version = json_datacards["maus_version"]
209
213
        return {
210
214
            "start_of_job":start_of_job,