def skip_unknown_host(func):
@functools.wraps(func)
def _task(*args, **kwargs):
if fab.env.get('host_string', False):
return func(*args, **kwargs)
fabricio.log(
"'{func}' execution was skipped due to no host provided "
"(command: {command})".format(
func=func.__name__,
command=fab.env.command,
)
)
_task.wrapped = func # compatibility with 'fab --display <task>' option
return _task
评论列表
文章目录