wuttamess.util
¶
Misc. Utilities
- wuttamess.util.exists(c, path)[source]¶
Returns
True
if given path exists on the host, otherwiseFalse
.
- wuttamess.util.get_home_path(c, user=None)[source]¶
Get the path to user’s home folder on target machine.
- Parameters:
c – Fabric connection.
user – Username whose home folder you want. If not specified, the username for the current connection is assumed.
- Returns:
Home folder path as string.
- wuttamess.util.is_symlink(c, path)[source]¶
Check if the given path is a symlink.
- Parameters:
c – Fabric connection.
path – Path to check, on target machine.
- Returns:
True
if path is a symlink, elseFalse
.
- wuttamess.util.mako_renderer(c, env={})[source]¶
This returns a function suitable for use as a
fabsync
file renderer. The function assumes the file is a Mako template.- Parameters:
c – Fabric connection.
env – Environment dictionary to be used as Mako template context.
Typical usage is something like:
from fabric import task from wuttamess import sync, util root = sync.make_root('files') env = {} @task def foo(c): # define possible renderers for fabsync renderers = {'mako': util.mako_renderer(c, env)} sync.check_isync(c, root, 'etc/postfix', renderers=renderers)