Permalink
Browse files

Cut the length of update_index() way down by using sudo -u <apache us…

…er> instead of chowning the whoosh dir back and forth.
  • Loading branch information...
mattdeboard committed May 8, 2011
1 parent 360f1e2 commit db554d7888de94ef65d843ba4f3cf9e87346cdc6
Showing with 4 additions and 6 deletions.
  1. +4 −6 fabfile.py
View
@@ -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/"
@@ -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"

0 comments on commit db554d7

Please sign in to comment.