Bug #40

avatar

get() not correctly detecting number of hosts

Added by Jeff Forcier 407 days ago. Updated 2 days ago.

Status:Assigned Start:07/28/2009
Priority:Normal Due date:
Assigned to:avatarJeff Forcier % Done:

0%

Category:Operations
Target version:1.1

Description

Scenario is the use of one task to set env.hosts, then a 2nd task called after it without any @hosts usage (so that the previous set of env.hosts takes effect.)

get(), in this case, is appending hostnames as if there were more than one host. Either there’s a bug in how it looks at env.all_hosts, or env.all_hosts is not being set correctly.

History

Updated by Jeff Forcier 304 days ago

avatar
  • Target version changed from 0.9 to 0.9.1

Updated by Jeff Forcier 304 days ago

avatar
  • Category set to Operations

Updated by Jeff Forcier 301 days ago

avatar
  • Target version changed from 0.9.1 to 0.9.2

Updated by Jeff Forcier 245 days ago

avatar
  • Status changed from New to Assigned

Updated by Jeff Forcier 35 days ago

avatar
  • Status changed from Assigned to Worksforme

This seems to work correctly right now, going by the code. Partly my fault for not filing a more detailed ticket — but if task A sets env.hosts to a list of >1 host, then yes, env.all_hosts will be set to that new host list upon execution of a task B, and thus get calls inside task B will — correctly! — use hostname append to differentiate the downloads.

Updated by Jeff Forcier 35 days ago

avatar
  • Status changed from Worksforme to Assigned

Revert that, working with Morgan to write a test for this, which should be done even if it’s currently working.

Updated by Morgan Goose 35 days ago

avatar

A test fabfile:

#!/usr/bin/env python
from fabric.api import get, env

def setup():
    env.hosts = ['somehost.com']

def setup2():
    env.hosts = ['somehost.com', 'somehost2.com']

def a():
    get('~/test.cpp', '/tmp/')

There are two behaviors that are desired here. First with:

fab setup a

That there only be test.cpp in /tmp/. The second being that with:

fab setup2 a

That now there are two files created with suffix that are their respective origin hosts. In testing this it looks good. So the ticket seems to have been solved in the further development of Fabric.

Updated by Jeff Forcier 3 days ago

avatar
  • Target version changed from 0.9.2 to 0.9.3

Updated by Jeff Forcier 2 days ago

avatar
  • Target version changed from 0.9.3 to 1.0

Updated by Jeff Forcier 2 days ago

avatar
  • Target version changed from 1.0 to 1.1

Also available in: Atom