Fabric env.hosts and run in the same method => No hosts found

Viewed 2649

Why:

from fabric.api import env, run

def update():
    env.hosts = ['apycat']
    run('cd /var/www/menu; svn up')

does not work when I fab update, while:

from fabric.api import env, run

env.hosts = ['apycat']

def update():
    run('cd /var/www/menu; svn up')

does?

Didn't find anything about this in the docs.

1 Answers
Related