def provision_for_any_user(node, package_source, variants=()):
 username = node.get_default_username()
 if (username == 'root'):
  return provision_as_root(node, package_source, variants)
 commands = []
 start = []
 def for_thirty_seconds(*args, **kwargs):
  if (not start):
   start.append(time())
  return Effect(Constant(((time() - start[0]) < 30)))
 commands.append(run_remotely(username=username, address=node.address, commands=retry(task_install_ssh_key(), for_thirty_seconds)))
 commands.append(run_remotely(username=username, address=node.address, commands=task_enable_root_logins(node.distribution)))
 commands.append(provision_as_root(node, package_source, variants))
 return sequence(commands)

def provision_for_any_user ( node , package_source , variants = ( ) ) : username = node . get_default_username ( ) if ( username == 'root' ) : return provision_as_root ( node , package_source , variants ) commands = [ ] start = [ ] def for_thirty_seconds ( * args , ** kwargs ) : if ( not start ) : start . append ( time ( ) ) return Effect ( Constant ( ( ( time ( ) - start [ 0 ] ) < 30 ) ) ) commands . append ( run_remotely ( username = username , address = node . address , commands = retry ( task_install_ssh_key ( ) , for_thirty_seconds ) ) ) commands . append ( run_remotely ( username = username , address = node . address , commands = task_enable_root_logins ( node . distribution ) ) ) commands . append ( provision_as_root ( node , package_source , variants ) ) return sequence ( commands )
provision flocker on a node using the default user .