code: def prepare_module(self):
          
          # Modules can define a post_config_hook() method which will be run
          # after the module has had it config settings applied and before it has
          # its main method(s) called for the first time.  This allows modules to
          # perform any necessary setup.
          if self.has_post_config_hook:
              try:
                  self.module_class.post_config_hook()
              except Exception as e:
                  # An exception has been thrown in post_config_hook() disable
                  # the module and show error in module output
                  self.terminated = True
                  self.error_index = 0
  
                  self.error_messages = [
                      self.module_nice_name,
                      u"{}: {}".format(
                          self.module_nice_name, str(e) or e.__class__.__name__
                      ),
                  ]
                  self.error_output(self.error_messages[0])
                  msg = "Exception in `%s` post_config_hook()" % self.module_full_name
                  self._py3_wrapper.report_exception(msg, notify_user=False)
                  self._py3_wrapper.log("terminating module %s" % self.module_full_name)
          self.enabled = True
docs: Ready the module to get it ready to start.