fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] Referencing submodule tasks in a parent


From: Sean Laurent
Subject: [Fab-user] Referencing submodule tasks in a parent
Date: Mon, 23 Apr 2012 16:48:12 -0500

So I have a submodule called "web" and it has an "__init__.py", as well as two modules:

fabfile/
  __init__.py
  web/
    __init__.py
    admin.py
    webapp.py

In web/__init__.py, I have defined a function called "install_latest_webapp()" that should run on a remote machine. Within admin.py and webapp.py, I defined tasks to install the latest "development" version of a webapp. The scripts look something like:

--admin.py---
from fabric.api import *

@task
def deploy_dev():
    install_latest_webapp("admin", "development")
---end---

That worked great. But then I wanted to define a separate task in web/__init__.py that calls install_latest_webapp() in both admin.py and webapp.py:

---web/__init__.py---
from fabric.api import *
import admin
import webapp
@task
def deploy_dev():
  admin.install_latest_webapp()
  webapp.install_latest_webapp()
---end---

That doesn't work:

AttributeError: 'module' object has no attribute 'install_latest_webapp'

What's the best way to accomplish this?

-Sean

reply via email to

[Prev in Thread] Current Thread [Next in Thread]