def init_rooter():
 cuckoo = Config()
 if ((not Config('vpn').vpn.enabled) and (cuckoo.routing.route == 'none')):
  return
 cuckoo = Config()
 s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
 try:
  s.connect(cuckoo.cuckoo.rooter)
 except socket.error as e:
  if (e.strerror == 'No such file or directory'):
   raise CuckooStartupError('The rooter is required but it is either not running or it has been configured to a different Unix socket path. (In order to disable the use of rooter, please set route and internet to none in cuckoo.conf and enabled to no in vpn.conf).')
  if (e.strerror == 'Connection refused'):
   raise CuckooStartupError("The rooter is required but we can't connect to it as the rooter is not actually running. (In order to disable the use of rooter, please set route and internet to none in cuckoo.conf and enabled to no in vpn.conf).")
  if (e.strerror == 'Permission denied'):
   raise CuckooStartupError("The rooter is required but we can't connect to it due to incorrect permissions. Did you assign it the correct group? (In order to disable the use of rooter, please set route and internet to none in cuckoo.conf and enabled to no in vpn.conf).")
  raise CuckooStartupError(('Unknown rooter error: %s' % e))
 rooter('forward_drop')

def init_rooter ( ) : cuckoo = Config ( ) if ( ( not Config ( 'vpn' ) . vpn . enabled ) and ( cuckoo . routing . route == 'none' ) ) : return cuckoo = Config ( ) s = socket . socket ( socket . AF_UNIX , socket . SOCK_DGRAM ) try : s . connect ( cuckoo . cuckoo . rooter ) except socket . error as e : if ( e . strerror == 'No such file or directory' ) : raise CuckooStartupError ( 'The rooter is required but it is either not running or it has been configured to a different Unix socket path. (In order to disable the use of rooter, please set route and internet to none in cuckoo.conf and enabled to no in vpn.conf).' ) if ( e . strerror == 'Connection refused' ) : raise CuckooStartupError ( "The rooter is required but we can't connect to it as the rooter is not actually running. (In order to disable the use of rooter, please set route and internet to none in cuckoo.conf and enabled to no in vpn.conf)." ) if ( e . strerror == 'Permission denied' ) : raise CuckooStartupError ( "The rooter is required but we can't connect to it due to incorrect permissions. Did you assign it the correct group? (In order to disable the use of rooter, please set route and internet to none in cuckoo.conf and enabled to no in vpn.conf)." ) raise CuckooStartupError ( ( 'Unknown rooter error: %s' % e ) ) rooter ( 'forward_drop' )
if required .