3 Replies Latest reply on Jan 10, 2019 3:04 AM by Alexander Foldats

    Problem listing properties of redhat rpms

    Alexander Foldats
      Share:|

      Hello,

       

      I have created a NSH script with BLCLI to first list all of the Kernel RPMs inside a Redhat Patch Catalog and with that list loop through and print 2 properties:

       

      RPM_BUILD_DATE*

      RPM_PACKAGE*

       

      But when I run the script it works and starts creating the file i need, but the just stops, it gets stuck in the loop at some point and won't continue, and i'm not sure why...

       

      #!/bin/nsh
      blcli_connect
      #Get all Kernels in Unix Catalog
      # RedHat
      sgType=5018
      
      
      catalogPath="/Patch_Catalog/RHEL Patch Catalog"
      sgName="Kernels"
      
      
      
      
      blcli_execute Group groupNameToId "${catalogPath}/${sgName}" ${sgType}
      blcli_storeenv sgId
      blcli_execute DepotObject findAllHeadersByGroup ${sgId}
      blcli_execute SDepotObjectHeader getName
      blcli_execute Utility setTargetObject
      patchlist=`blcli_execute Utility listPrint`
      
      
      #Set up CSV file
      echo "RPM,RPM Package,RPM Release Date">"/tmp/RedHat_Kernels_ReleaseDate.csv"
      
      
      blcli_execute Group groupNameToId "/Patch_Catalog/RHEL Patch Catalog" 5020
      groupKey=`blcli_execute Group getDBKey`
      
      
      #Start Loop to extract build date and package type for each RPM in the catalog
      
      
      for patch in $patchlist;do
      blcli_execute DepotObject findByTypeGroupAndName 68 $groupKey "$patch"
      BUILD_DATE=`blcli_execute DepotObject getFullyResolvedValueAsString 'RPM_BUILD_DATE*'`
      PACKAGE_TYPE=`blcli_execute DepotObject getFullyResolvedValueAsString 'RPM_PACKAGE*'`
      echo "$patch,$PACKAGE_TYPE,$BUILD_DATE">>"/tmp/RedHat_Kernels_ReleaseDate.csv"
      done
      

       

      This is what i get when I do a tail on the file while it runs

       

      tail -500f RedHat_Kernels_ReleaseDate.csv
      RPM,RPM Package,RPM Release Date
      kernel-3.10.0-327.4.4.el7.x86_64.rpm,kernel,2015-12-17 00:00:00
      kernel-2.6.32-642.3.1.el6.x86_64.rpm,kernel,2016-06-27 00:00:00
      kernel-2.6.32-358.0.1.el6.x86_64.rpm,kernel,2013-02-20 00:00:00
      kernel-3.10.0-123.6.3.el7.x86_64.rpm,kernel,2014-07-16 00:00:00
      kernel-2.6.32-431.29.2.el6.x86_64.rpm,kernel,2014-07-27 00:00:00
      kernel-2.6.32-220.el6.x86_64.rpm,kernel,2011-11-09 00:00:00
      

       

      it goes through some lines, but then stops. And there are 159 objects in the smart group.

       

      Any help would be appreciated, or any alternative.