Permalink
Browse files

Missed a couple spaces in my call() routines, broke my script.

  • Loading branch information...
1 parent ec087b2 commit 7b54f791f2ed512e8b1d935ef2c9c830ca85034d @mattdeboard committed May 8, 2011
Showing with 0 additions and 48 deletions.
  1. +0 −48 srchupdate2.py
View
48 srchupdate2.py
@@ -1,48 +0,0 @@
-import os
-import subprocess
-import sys
-import logging
-
-domain_dir = "/a/mattdeboard.net/"
-appdir = domain_dir + "src/yukproj/"
-whoosh_dir = appdir + "yuk/whoosh/"
-
-def update():
- logging.basicConfig(filename='/a/mattdeboard.net/src/index.log',
- level=logging.INFO,
- format='%(asctime)s %(levelname)s:%(message)s',
- datefmt='%m/%d/%Y %H:%M:%S')
- logging.info('Starting index update.')
- try:
- mattwhoosh = subprocess.call(['sudo', 'chown', 'matt:matt '+whoosh_dir])
- mattwhooshfiles = subprocess.call(['sudo', 'chown',
- 'matt:matt '+whoosh_dir+'*'])
- update_index = subprocess.call([domain_dir+'bin/python',
- appdir+'manage.py update_index'])
- apachewhsh = subprocess.call(['sudo', 'chown',
- 'www-data:www-data '+whoosh_dir])
- apachewhsh2 = subprocess.call(['sudo', 'chown',
- 'www-data:www-data '+whoosh_dir+'*'])
- apachereload = subprocess.call(['sudo',
- '/etc/init.d/apache2', 'force-reload'])
- if sum(mattwhoosh, mattwhooshfiles, update_index, apachewhsh,
- apachewhsh2, apachereload) == 0:
- logging.info('Index successfully updated.')
- else:
- logging.error('**INDEX UPDATE FAILED**')
- logging.error('The following exit codes were returned:')
- logging.error('- mattwhoosh: %s' % mattwhoosh)
- logging.error('- mattwhooshfiles: %s' % mattwhooshfiles)
- logging.error('- update_index: %s' % update_index)
- logging.error('- apachewhsh: %s' % apachewhsh)
- logging.error('- apachewhsh2: %s' % apachewhsh2)
- logging.error('- apachereload: %s' % apachereload)
- except:
- logging.error("Exception received: ",
- sys.exc_info()[0],
- sys.exc_info()[1])
-
-
-if __name__ == '__main__':
- update()
-

0 comments on commit 7b54f79

Please sign in to comment.