[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] NameError when using rsync_project in fabfile
From: |
Matthew T Rich |
Subject: |
[Fab-user] NameError when using rsync_project in fabfile |
Date: |
Thu, 3 May 2012 21:13:46 +0000 |
Hi all,
I have a simple fabfile based on the one in the django docs for deploying
static files:
import os
from fabric.api import env, roles, local
from fabric.contrib import project
env.project_root = os.path.abspath(
os.path.dirname(__file__)
)
env.local_static_root = os.path.abspath(
os.path.join(
env.project_root,
'static'
)
)
env.remote_static_root = '/usr/local/www/myproj'
env.roledefs = {
'media': ['media.server.northwestern.edu',],
}
@roles('media')
def deploy_media():
local('python manage.py collectstatic --noinput')
options = {
'remote_dir': env.remote_static_root,
'local_dir': env.local_static_root,
'delete': True
}
project.rysnc_project(**options)
When I run this (via `fab deploy_media`) I get this traceback:
Traceback (most recent call last):
File
"/Users/mtr932/Documents/virtualenvs/toolbox-upgrade/lib/python2.6/site-packages/fabric/main.py",
line 712, in main
*args, **kwargs
File
"/Users/mtr932/Documents/virtualenvs/toolbox-upgrade/lib/python2.6/site-packages/fabric/tasks.py",
line 298, in execute
multiprocessing
File
"/Users/mtr932/Documents/virtualenvs/toolbox-upgrade/lib/python2.6/site-packages/fabric/tasks.py",
line 197, in _execute
return task.run(*args, **kwargs)
File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/contextlib.py",
line 34, in __exit__
self.gen.throw(type, value, traceback)
File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/contextlib.py",
line 113, in nested
yield vars
File
"/Users/mtr932/Documents/virtualenvs/toolbox-upgrade/lib/python2.6/site-packages/fabric/tasks.py",
line 197, in _execute
return task.run(*args, **kwargs)
File
"/Users/mtr932/Documents/virtualenvs/toolbox-upgrade/lib/python2.6/site-packages/fabric/tasks.py",
line 112, in run
return self.wrapped(*args, **kwargs)
File
"/Users/mtr932/Documents/virtualenvs/toolbox-upgrade/lib/python2.6/site-packages/fabric/decorators.py",
line 47, in inner_decorator
return func(*args, **kwargs)
File "/Users/mtr932/Documents/Work/ctd-toolbox/numats-toolbox/fabfile.py",
line 32, in deploy_media
project.rysnc_project(**options)
AttributeError: 'module' object has no attribute 'rysnc_project'
I have verified that in the python interactive interpreter I can indeed `from
fabric.contrib import project; project.rsync_project()` and it runs properly.
Any ideas? This is Fabric 1.4.1, python 2.6.1.
Thanks,
Matthew
--
Matthew Rich
Senior Web Application Developer
Northwestern University
School of Education and Social Policy
Annenberg Hall, Room 249
+1 847 467 2819
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fab-user] NameError when using rsync_project in fabfile,
Matthew T Rich <=