code: def run(self):
          
          logger = logging.getLogger(__name__)
          try:
              # Check repository GPG settings before starting workers
              # Handling this here prevents subprocesses from needing stdin access
              repo_conf = self.config['repository']
              repo = None
              if repo_conf['enabled'] and repo_conf['gpg_verify']:
                  try:
                      repo = Repository(repo_conf['url'],
                                        repo_conf['gpg_verify'])
                      repo.init_gpg()
                  except Exception as ex:
                      # Do not prompt to install gpg keys unless running interactively
                      if repo is not None and self.library is False:
                          if isinstance(ex, RepositoryUntrustedSigningKeyError):
                              installed = repo.prompt_for_install()
                              if installed is False:
                                  logger.critical(("repository signature not "
                                                   "installed, install the "
                                                   "signature manually or use "
                                                   "the --gpg-no-verify flag "
                                                   "to bypass this check"))
                                  quit(1)
                      else:
                          logger.critical(ex)
                          quit(1)
  
              conf = self.map_config()
              workers = Workers(conf, self.config['workers'], name=self.name, library=self.library)
              description = 'memory capture action'
              results = workers.spawn(description)
  
              self.statistics(results)
              if self.library is True:
                  return dict([('total', self.total),
                               ('completed', self.completed_addresses),
                               ('failed', self.failed_addresses)])
              else:
                  logger.info(("{0} hosts processed. completed: {1} "
                               "failed {2}".format(self.total, self.completed,
                                                   self.failed)))
                  logger.info("completed_hosts: {0}".format(self.completed_addresses))
                  logger.info("failed_hosts: {0}".format(self.failed_addresses))
                  quit()
          except KeyboardInterrupt:
              workers.cleanup(terminate=True)
              if self.library:
                  raise
              else:
                  quit(1)
docs: Captures remote hosts memory