code: def _check_pkg(target):
      '''
      Return name, version and if rpm package for specified target
      '''
      ret = {}
      cmd = ['/usr/bin/lslpp', '-Lc', target]
      lines = __salt__['cmd.run'](
              cmd,
              python_shell=False).splitlines()
  
      name = ''
      version_num = ''
      rpmpkg = False
      for line in lines:
          if line.startswith('#'):
              continue
  
          comps = line.split(':')
          if len(comps) < 7:
              raise CommandExecutionError(
                  'Error occurred finding fileset/package',
                  info={'errors': comps[1].strip()})
  
          # handle first matching line
          if 'R' in comps[6]:
              name = comps[0]
              rpmpkg = True
          else:
              name = comps[1]     # use fileset rather than rpm package
  
          version_num = comps[2]
          break
  
      return name, version_num, rpmpkf _check_pkg(target):
      '''
      Return name, version and if rpm package for specified target
      '''
      ret = {}
      cmd = ['/usr/bin/lslpp', '-Lc', target]
      lines = __salt__['cmd.run'](
              cmd,
              python_shell=False).splitlines()
  
      name = ''
      version_num = ''
      rpmpkg = False
      for line in lines:
          if line.startswith('#'):
              continue
  
          comps = line.split(':')
          if len(comps) < 7:
              raise CommandExecutionError(
                  'Error occurred finding fileset/package',
                  info={'errors': comps[1].strip()})
  
          # handle first matching line
          if 'R' in comps[6]:
              name = comps[0]
              rpmpkg = True
          else:
              name = comps[1]     # use fileset rather than rpm package
  
          version_num = comps[2]
          break
  
      return name, version_num, rpmpkg
docs: Return name, version and if rpm package for specified target