code: def is_package_installed(self, package_name):
          
          if not package_name:
              raise ValueError('package_name required.')
  
          installed = True
          try:
              Cmd.sh_e('{0} --query {1} --quiet'.format(self.rpm_path,
                                                        package_name))
          except InstallError:
              installed = False
          return installed
docs: Check if the RPM package is installed.