Skip to content

Commit

Permalink
Cut the length of update_index() way down by using sudo -u <apache us…
Browse files Browse the repository at this point in the history
…er> instead of chowning the whoosh dir back and forth.
  • Loading branch information
mattdeboard committed May 8, 2011
1 parent 360f1e2 commit db554d7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fabfile.py
Expand Up @@ -2,8 +2,9 @@
from time import gmtime

from fabric.api import *
from hosts import hosts
from hosts import hosts, secret

env.password = secret
env.hosts = hosts
domain_dir = "/a/mattdeboard.net/"
appdir = domain_dir + "src/yukproj/"
Expand Down Expand Up @@ -37,11 +38,8 @@ def dump_data():
(domain_dir, appdir, timestamp))

def update_search():
run("cd %s; . bin/activate; cd %s; sudo chown matt:matt %s; sudo chown matt"
":matt %s*; ./manage.py update_index; sudo chown www-data:www-data %s; "
"sudo chown www-data:www-data %s*; sudo /etc/init.d/apache2 force-reloa"
"d" % (domain_dir, appdir, whoosh_dir,
whoosh_dir, whoosh_dir, whoosh_dir))
run("sudo -u www-data /a/mattdeboard.net/bin/python %smanage.py update_inde"
"x; sudo /etc/init.d/apache2 force-reload" % appdir)

def rebuild_search():
run("cd %s; . bin/activate; cd %s; sudo chown matt:matt %s; sudo chown matt"
Expand Down

0 comments on commit db554d7

Please sign in to comment.