parameters: ()
return_statement: return True
docstring: Check if config files exist.
      @raise CuckooStartupError: if config files do not exist.
docstring_summary: Check if config files exist.
docstring_tokens: Check if config files exist .
function: def check_configs():
      """Check if config files exist.
      @raise CuckooStartupError: if config files do not exist.
      """
      configs = (
          "auxiliary", "cuckoo", "memory", "processing", "reporting", "routing",
      )
  
      for filename in configs:
          if not os.path.exists(cwd("conf", "%s.conf" % filename)):
              raise CuckooStartupError(
                  "Config file does not exist at path: %s" %
                  cwd("conf", "%s.conf" % filename)
              )
  
          check_specific_config(filename)
  
      # Also check the specific machinery handler for this instance.
      machinery = config("cuckoo:cuckoo:machinery")
      if machinery not in Config.configuration:
          raise CuckooStartupError(
              "An unknown machinery has been chosen (machinery=%s)!" % machinery
          )
  
      check_specific_config(machinery)
  
      # If Cuckoo Feedback is enabled, ensure its configuration is valid.
      feedback_enabled = (
          config("cuckoo:feedback:enabled") or
          config("reporting:feedback:enabled")
      )
      if feedback_enabled:
          try:
              CuckooFeedbackObject(
                  name=config("cuckoo:feedback:name"),
                  email=config("cuckoo:feedback:email"),
                  company=config("cuckoo:feedback:company"),
                  message="startup"
              ).validate()
          except CuckooFeedbackError as e:
              raise CuckooStartupError(
                  "You have filled out the Cuckoo Feedback configuration, but "
                  "there's an error in it: %s" % e
              )
      return True
function_tokens: def check_configs ( ) : configs = ( "auxiliary" , "cuckoo" , "memory" , "processing" , "reporting" , "routing" , ) for filename in configs : if not os . path . exists ( cwd ( "conf" , "%s.conf" % filename ) ) : raise CuckooStartupError ( "Config file does not exist at path: %s" % cwd ( "conf" , "%s.conf" % filename ) ) check_specific_config ( filename ) # Also check the specific machinery handler for this instance. machinery = config ( "cuckoo:cuckoo:machinery" ) if machinery not in Config . configuration : raise CuckooStartupError ( "An unknown machinery has been chosen (machinery=%s)!" % machinery ) check_specific_config ( machinery ) # If Cuckoo Feedback is enabled, ensure its configuration is valid. feedback_enabled = ( config ( "cuckoo:feedback:enabled" ) or config ( "reporting:feedback:enabled" ) ) if feedback_enabled : try : CuckooFeedbackObject ( name = config ( "cuckoo:feedback:name" ) , email = config ( "cuckoo:feedback:email" ) , company = config ( "cuckoo:feedback:company" ) , message = "startup" ) . validate ( ) except CuckooFeedbackError as e : raise CuckooStartupError ( "You have filled out the Cuckoo Feedback configuration, but " "there's an error in it: %s" % e ) return True