Bug #47
env.hosts should be a list initially.
| Status: | Done | Start: | 08/09/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 100% |
||
| Category: | Core | |||
| Target version: | 0.9 | |||
Description
I would like to have commands to append hosts in the host env variable, sort of like:
def production():
env.hosts.append("production.com")
def staging():
env.hosts.append("staging.com")
Right now, however, env.hosts is None, so I need to check and assign a list to it every time. It should be a list initially so we can just append to it.
Associated revisions
Revision fe80a6538843ad6213f4de0b69c5889581a5408e
Update role/host initialization logic.
History
Updated by Jeff Forcier 395 days ago
- Assigned to set to Jeff Forcier
- Target version set to 1.0
Will have to double check to make sure there’s no specific reason for this (unlikely but possible) and assuming nothing would be broken by making this change, it’s definitely a good idea.
Updated by Stavros Korokithakis 395 days ago
If any checks that require env.hosts to be empty check for “if not env.hosts” instead of “if env.hosts is None”, there shouldn’t be any problems. I'd try myself, but git is a bit of a large barrier to entry when you’re in Windows :/
Updated by Jeff Forcier 395 days ago
I mostly meant “is there an actual reason for it to be None instead of an empty list”, i.e. if in some corner of the code an empty host list meant something distinct from a None host list. Not that I can think of any such spots — I'm just really paranoid :)
Updated by Stavros Korokithakis 395 days ago
A paranoid coder is a good coder! Aren’t there unit tests?
Updated by Jeff Forcier 395 days ago
Some, but not nearly enough, something I plan to work on for Fab 1.0 (originally for 0.9 but I really need to get it out ASAP). Will actually be writing some more today in a “try to test before you bugfix” approach, but for a different issue than this one :)
Updated by Jeff Forcier 395 days ago
- Status changed from New to Done
- % Done changed from 0 to 100
Applied in changeset fe80a6538843ad6213f4de0b69c5889581a5408e.
Also available in: Atom