code: def get_rpms(self):
          
  
          tags = [
              'NAME',
              'VERSION',
              'RELEASE',
              'ARCH',
              'EPOCH',
              'SIGMD5',
              'SIGPGP:pgpsig',
              'SIGGPG:pgpsig',
          ]
  
          cmd = "/bin/rpm " + rpm_qf_args(tags)
          try:
              # py3
              (status, output) = subprocess.getstatusoutput(cmd)
          except AttributeError:
              # py2
              with open('/dev/null', 'r+') as devnull:
                  p = subprocess.Popen(cmd,
                                       shell=True,
                                       stdin=devnull,
                                       stdout=subprocess.PIPE,
                                       stderr=devnull)
  
                  (stdout, stderr) = p.communicate()
                  status = p.wait()
                  output = stdout.decode()
  
          if status != 0:
              self.log.debug("%s: stderr output: %s", cmd, stderr)
              raise RuntimeError("%s: exit code %s" % (cmd, status))
  
          return parse_rpm_output(output.splitlines(), tags)
docs: Build a list of installed RPMs in the format required for the
          metadata.