4 Replies Latest reply on Dec 8, 2010 7:12 AM by Roger May

    Patch Catalog hotfix DBKey

      Hi

       

      Can anyone tell me how to find the DBKey for a particular hotfix, given its Qnumber in a windows patch catalog using the blcli_execute commands please?

       

      This is driving me mad - I want to set a parameter on a number of specific hotfixes - which I have as a list of Qnumbers, and I can see the command I need to do that  - DepotObject setPropertyValue, but the first parameter is the DBkey and I can't see how to get that for a hotfix inside a patch catalog

       

      HELP!!

       

      Cheers

       

      Roger

        • 1. Patch Catalog hotfix DBKey
          Paul Seager-Smith

          Hi Roger,

           

          You will need to go for unreleased commands to get this. Since the hotfix is a Depot Object with a specific type (114 for all hotfixes I believe), you can use Depot Object commands with this type. For example

           

          Depot Object  findAllByTypeAndName

           

          should give you an object that you can then use with getDBKey

           

          Normally you should be able to use

           

          getDBKeyByTypeGroupAndName

           

          but the trouble is that Hotfixes don't belong to a group (at least not one that I could figure out) ...

           

          Regards,

           

          Paul

          1 of 1 people found this helpful
          • 2. Patch Catalog hotfix DBKey

            Hi Paul,

             

            Thanks for your reply. I tihnk it has got me bit closer, but I'm still not quite there..

             

            So now I'm using

             

            DepotObject findAllByTypeandName 114 "name of hotfix"

            which returns java.util.List

            I then run

            DepotObject getDBKey

            and store the result in DBKEY using blcli_storeenv

            I then use $DBKEY in setPropertyValue as follows:-

            DepotObject setPropertyValue $DBKEY RELEASE_STATUS DEV

            but this fails with

            DepotObject.setPropertyValue' but with mismatching arguments.

             

            I'm not sure if DepotObject getDBKey is actually returning a DBKey, cos the statement before returns a java.util.List

             

            ?

             

            Cheers

             

            Roger

            • 3. Patch Catalog hotfix DBKey
              Paul Seager-Smith

              yes, sorry there is a missing step in there. As you say the find returns a list and you need to get the actual object.

               

              You need to use something like:

                 blcli_execute DepotObject getDBKey

                  blcli_execute Utility setTargetObject

                  blcli_execute Utility listPrint

                  blcli_storeenv PATCH_KEYS

               

                  for PATCH_KEY in $PATCH_KEYS

                  do

                        set property

                 done

              1 of 1 people found this helpful
              • 4. Patch Catalog hotfix DBKey

                Hi Paul,

                 

                OK, probably being really thick here but the commands inside the do-done loop work ok as they are, but not inside do-done loop. I've checked that the NAME parameter is being read ok. The file Prod.csv just contain hotfix names  Any ideas?  losing the will to live here.......

                 

                cat Prod.csv | while read NAME
                do
                  blcli_execute DepotObject findAllByTypeAndName 114 "$NAME"
                  blcli_execute DepotObject getDBKey
                  blcli_execute Utility setTargetObject
                  blcli_execute Utility listPrint
                  blcli_storeenv DBKEY
                  blcli_execute DepotObject setPropertyValue $DBKEY RELEASE_STATUS Production
                done

                 

                using set -x I can see the following output, which seems to show that the commands are returning null when inside the loop ?

                 

                +./set_param.nsh:9> cat Prod.csv

                +./set_param.nsh:9> read NAME

                +./set_param.nsh:11> blcli_execute DepotObject findAllByTypeAndName 114 'WINDOWS

                'SERVER 2008, WEB EDITION (X64) SP2-en

                []+./set_param.nsh:12> blcli_execute DepotObject getDBKey

                []+./set_param.nsh:13> blcli_execute Utility setTargetObject

                []+./set_param.nsh:14> blcli_execute Utility listPrint

                +./set_param.nsh:15> blcli_storeenv DBKEY

                +./set_param.nsh:16> blcli_execute DepotObject setPropertyValue RELEASE_STATUS P

                roduction

                Command execution failed. com.bladelogic.cli.factory.CommandNotFoundException: F

                ound command 'DepotObject.setPropertyValue' but with mismatching arguments.

                +./set_param.nsh:9> read NAME