code: def _get_patches(installed_only=False):
      '''
      List all known patches in repos.
      '''
      patches = {}
  
      cmd = [_yum(), '--quiet', 'updateinfo', 'list', 'all']
      ret = __salt__['cmd.run_stdout'](
          cmd,
          python_shell=False
      )
      for line in salt.utils.itertools.split(ret, os.linesep):
          inst, advisory_id, sev, pkg = re.match(r'([i|\s]) ([^\s]+) +([^\s]+) +([^\s]+)',
                                                 line).groups()
          if inst != 'i' and installed_only:
              continue
          patches[advisory_id] = {
              'installed': True if inst == 'i' else False,
              'summary': pkg
          }
      return patchef _get_patches(installed_only=False):
      '''
      List all known patches in repos.
      '''
      patches = {}
  
      cmd = [_yum(), '--quiet', 'updateinfo', 'list', 'all']
      ret = __salt__['cmd.run_stdout'](
          cmd,
          python_shell=False
      )
      for line in salt.utils.itertools.split(ret, os.linesep):
          inst, advisory_id, sev, pkg = re.match(r'([i|\s]) ([^\s]+) +([^\s]+) +([^\s]+)',
                                                 line).groups()
          if inst != 'i' and installed_only:
              continue
          patches[advisory_id] = {
              'installed': True if inst == 'i' else False,
              'summary': pkg
          }
      return patches
docs: List all known patches in repos.