11 Replies Latest reply on Jul 6, 2011 5:41 PM by Bill Robinson

    recursivelySetPropertyForCatalog

      Hello,

       

      I'm trying to set a property on all windows hotfixes of a patch catalog using recursivelySetPropertyForCatalog command.

      But everytime, I run my script I have the following error

       

      Error    Jun 29, 2011 1:48:06 PM    Command execution failed. com.bladelogic.mfw.util.BlException: Invalid qualified group name : "/W2K3_English_Patch-Catalog_V5/OUT_OF_SCOPE"

       

      It seems that my issue came from the folderpath to use but I don't find why.

       

      Thanks in advance for your help

        • 1. Re: recursivelySetPropertyForCatalog
          Bill Robinson

          Are you specifying the path to the catalog or the path to a smart group in the catalog?

           

          I believe you specify the path to the catalog.

          • 2. recursivelySetPropertyForCatalog

            Hello Bill,

             

            I tried both path of the catalog and path to a smartgroup in the catalog.

            I even tried specify directly the catalog and the smartgroup under it.

            But I'm not sure about the starting point.

            The example given in the help talk about /Depot2/objects but means nothing for me :-(

            • 3. Re: recursivelySetPropertyForCatalog
              Bill Robinson

              Where is your catalog in the folder structure?

              • 4. recursivelySetPropertyForCatalog

                Bill,

                 

                You're quick and I appreciate your help :-)

                Here is our folder structrure

                screenshot.1.png

                I would like to target "OUT_OF_SCOPE" smartgroup.

                 

                Regards

                 

                Johann

                • 5. recursivelySetPropertyForCatalog
                  Bill Robinson

                  The path to the catalog for the command will be:

                   

                  /8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V5/W2K3_English_Patch-Catalog_V5

                   

                  are you trying to update a property on all of the objects in the catalog, or only the objects in the smart group 'OUT_OF_SCOPE' ?

                   

                  if the latter, then you'll need a different command.

                  • 6. recursivelySetPropertyForCatalog

                    I already tried that path but with the same error.

                     

                    Info    Jun 29, 2011 1:10:17 PM    blcli_execute PatchCatalog recursivelySetPropertyForCatalog "/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V5/W2K3_English_Patch-Catalog_V5" _STATUS "NON APPLICABLE" HOTFIX_WINDOWS_INSTALLABLE

                    Info    Jun 29, 2011 1:10:17 PM    Exit Code 1

                    Error    Jun 29, 2011 1:10:17 PM    Command execution failed. com.bladelogic.mfw.util.BlException: Invalid qualified group name : "/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V5/W2K3_English_Patch-Catalog_V5"

                    Error    Jun 29, 2011 1:10:17 PM    Command execution failed. com.bladelogic.mfw.util.BlException: Invalid qualified group name : "/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V5/W2K3_English_Patch-Catalog_V5"

                     

                    But my objective is to update only objects in smart group "OUT_OF_SCOPE". Which command do you think of ?

                    • 7. Re: recursivelySetPropertyForCatalog
                      Bill Robinson

                      There is a typo in your path somewhere - maybe an extra space.  I'm able to execute that command successfully in my environment by passing a location of a catalog.

                       

                      You need to do something like this:

                       

                       

                      #!/bin/nsh

                      blcli_setoption serviceProfileName defaultProfile
                      blcli_setoption roleName BLAdmins
                      blcli_connect


                      groupName="<path to smart catalog group>"
                      groupType=5017
                      propName=<your prop>

                      propValue=<your value>

                      blcli_execute Group groupNameToId "${groupName}" ${groupType}
                      blcli_storeenv groupId
                      blcli_execute DepotObject findAllHeadersByGroup ${groupId}
                      blcli_execute SDepotObjectHeader getDBKey
                      blcli_execute Utility setTargetObject
                      blcli_execute Utility listPrint
                      blcli_execute Utility setTargetObject
                      blcli_storeenv depotKeys


                      for depotKey in ${depotKeys}
                              do
                              blcli_execute DepotObject setPropertyValue ${depotKey} "${propName}" "${propValue}"
                      done

                       

                      -----------------

                       

                      to get the proper path to your catalog can you do this:

                       

                       

                      -------------

                      blcli_setoption serviceProfileName defaultProfile
                      blcli_setoption roleName BLAdmins
                      blcli_connect

                      if [ `uname -s` = "WindowsNT" ]
                              then
                              NULL=NUL
                      else
                              NULL=/dev/null
                      fi

                      for CATALOG_TYPE in RED_HAT_CATALOG_GROUP SOLARIS_CATALOG_GROUP WINDOWS_CATALOG_GROUP
                      do
                              blcli_execute Utility convertModelType "${CATALOG_TYPE}" > ${NULL}
                              blcli_storeenv CATALOG_NUM > ${NULL}

                              blcli_execute Group findAllByGroupType ${CATALOG_NUM} > ${NULL}
                              blcli_execute Utility listPrint > ${NULL}
                              blcli_execute Utility setTargetObject > ${NULL}
                              blcli_storeenv GROUP_LIST > ${NULL}

                              IFS=;
                              GROUP_PATHS=`echo ${GROUP_LIST} | grep -v "Id ="`

                              echo ${GROUP_PATHS} | while read PATCH_CATALOG
                                      do
                                      echo "|||||${PATCH_CATALOG}|||||"
                              done
                      done

                      --------------------------

                      1 of 1 people found this helpful
                      • 8. Re: recursivelySetPropertyForCatalog

                        Hello Bill,

                         

                        thanks for your scripts, they work perfectly

                        Unfortunately, using still recursivelySetPropertyForCatalog doesn't work

                        I even do a copy/paste of the result of the second script to have a correct path but I still receive that damn error message "Invalid qualified group name"

                        I'll use your first script until I found where is my mistake.

                        • 9. Re: recursivelySetPropertyForCatalog
                          Bill Robinson

                          Can you paste the output of the 2nd script?

                          • 10. Re: recursivelySetPropertyForCatalog

                            Here the output of your second script.

                             

                            Info    Jul 4, 2011 10:41:16 AM    ||||||||||

                            Info    Jul 4, 2011 10:41:20 AM    ||||||||||

                            Info    Jul 4, 2011 10:41:24 AM    |||||/ARCHIVE - Software/99 - TO BE DELETED/8.4.1.1 - W2K3_English_Patch-Catalog_V4_First-proposal|||||

                            Info    Jul 4, 2011 10:41:24 AM    |||||/ARCHIVE - Software/99 - TO BE DELETED/8.4.1.4 - W2K3_English_Patch-Catalog_V4|||||

                            Info    Jul 4, 2011 10:41:24 AM    |||||/ARCHIVE - Software/99 - TO BE DELETED/W2K_English|||||

                            Info    Jul 4, 2011 10:41:24 AM    |||||/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V5/W2K3_English_Patch-Catalog_V5|||||

                            Info    Jul 4, 2011 10:41:24 AM    |||||/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V4/W2K3_English_Patch-Catalog_V4|||||

                            Info    Jul 4, 2011 10:41:24 AM    |||||/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V2/W2K_English_Patch-Catalog_V2|||||

                            Info    Jul 4, 2011 10:41:24 AM    |||||/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V3/W2K3_English_Patch-Catalog_V3|||||

                            Info    Jul 4, 2011 10:41:24 AM    |||||/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V6/W2K8_English_Patch-Catalog_V6|||||

                            Info    Jul 4, 2011 10:41:24 AM    Exit Code 0

                            • 11. Re: recursivelySetPropertyForCatalog
                              Bill Robinson

                              That's weird.

                               

                              do you get the same error with:

                               

                              blcli_execute PatchCatalog getCatalogDBKeyByFullyQualifiedCatalogName 5017 "/8 - Patch management/8.4 - Windows/8.4.1 - Catalog/V5/W2K3_English_Patch-Catalog_V5"

                               

                              that command should atleast run a little quicker.