def needs_host(func):
 from fabric.state import env
 @wraps(func)
 def host_prompting_wrapper(*args, **kwargs):
  while (not env.get('host_string', False)):
   handle_prompt_abort('the target host connection string')
   host_string = raw_input('No hosts found. Please specify (single) host string for connection: ')
   env.update(to_dict(host_string))
  return func(*args, **kwargs)
 host_prompting_wrapper.undecorated = func
 return host_prompting_wrapper

def needs_host ( func ) : from fabric . state import env @ wraps ( func ) def host_prompting_wrapper ( * args , ** kwargs ) : while ( not env . get ( 'host_string' , False ) ) : handle_prompt_abort ( 'the target host connection string' ) host_string = raw_input ( 'No hosts found. Please specify (single) host string for connection: ' ) env . update ( to_dict ( host_string ) ) return func ( * args , ** kwargs ) host_prompting_wrapper . undecorated = func return host_prompting_wrapper
prompt user for value of env .