6 Replies Latest reply on Feb 27, 2015 11:34 AM by Harish Gurram

    applyAclTemplate is failing on depot object

      Hi,

           I am trying to update the acltempates of depot objects(Bl Packages) through NSH script, but is failing with below error.Could some one suggest how to fix it current BSA version we are using is 8.2.04.532

      Command:

      DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

       

      Error:

      ErrorFeb 25, 2015 3:06:33 PM//@/opt/bmc/BladeLogic/8.0/NSH/tmp/JobServer04/scripts/job__1f632798-9b4e-4597-8c6b-3e7aeca86b24/script_DBKey-SJobKeyImpl-5409592-4__74b3bedc-899b-46b2-b866-1cb019d5de16.2874448.1_PaaS_Package_Promotion.txt:19: command not found: DepotObject

      Thanks

        • 1. Re: applyAclTemplate is failing on depot object
          Bill Robinson

          how are you running it ?

           

          DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

           

          or

           

          blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

           

          or

           

          blcli DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

           

          ?

          • 2. Re: applyAclTemplate is failing on depot object

            Hi Bill

            I am executing it as blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

            • 3. Re: applyAclTemplate is failing on depot object
              Bill Robinson

              can you attach your script ?

              • 4. Re: applyAclTemplate is failing on depot object

                PACKAGE_LOCATION=$1

                BUILD_VERSION=$2

                ROLE_USED=$3

                PKG_LIST=$4

                APACHE_PKGS=$5

                TEST_TEMPLATE=$6

                END2END_TEMPLATE=$7

                HOSTING_TEMPLATE=$8

                 

                 

                 

                 

                if [ "$ROLE_USED" = "USS_DEV_Deployment" ]

                then

                TEMPLATE=$TEST_TEMPLATE

                 

                 

                PKG_NAME="COHERENCE_OBJECTGRID_UPDATE_${BUILD_VERSION}"

                echo $PKG_NAME

                blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                blcli_storeenv PACKAGE_KEY

                blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

                ####################CONFIG PACKAGES######################

                PKG=($PKG_LIST)

                for PKGS in $PKG

                            do

                  if [ "$PKGS" = "DB_DEPLOYER" -o "$PKGS" = "POD_MIGRATION" -o "$PKGS" = "POD_CLIENT_SCRIPTS" -o "$PKGS" = "PORTAL" -o "$PKGS" = "COMP" -o "$PKGS" = "BATCH" ]

                   then

                   echo "Do Nothing As" $PKGS "is not Config"

                         else

                                 

                  PKG_NAME="TOMCAT_CONFIG_${PKGS}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

                  fi

                  done

                 

                #############META PACKAGES######################

                for PKGS in $PKG

                  do

                  if [ "$PKGS" = "COMMON" ]

                  then

                           

                                  PKG_NAME="META_${PKGS}_${BUILD_VERSION}"

                   echo "Complete Package Name is"=$PKG_NAME

                   blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                   blcli_storeenv PACKAGE_KEY

                   blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

                  else

                  if [ "$PKGS" = "DB_DEPLOYER" -o "$PKGS" = "POD_MIGRATION" -o "$PKGS" = "POD_CLIENT_SCRIPTS" ]

                  then

                  PKG_NAME="${PKGS}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

                  else

                  if [ "$PKGS" = "PORTAL" -o "$PKGS" = "COMP" -o "$PKGS" = "BATCH" ]

                  then

                  echo "Do Nothing As" $PKGS "is not DB Section"

                  else

                  PKG_NAME="META_APP_${PKGS}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

                  fi

                  fi

                  fi

                 

                  done

                 

                 

                ####################RPM SECTION#################################

                for PKGS in $PKG

                  do

                  if [ "$PKGS" = "PORTAL" -o "$PKGS" = "COMP" -o "$PKGS" = "BATCH" ]

                     then

                  PKG_NAME="TOMCAT_RPM_${PKGS}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

                  

                  else

                  echo "Do Nothing As" $PKGS "is not RPM"

                  fi

                 

                  done

                 

                ##################APACHE PACKAGES###########################

                for apache in $APACHE_PKGS

                            do

                  if [ "$apache" = "$APACHE_STATIC_PKG" ]

                  then

                  PKG_NAME="${apache}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

                  else

                  PKG_NAME="${apache}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE" true

                 

                  fi

                  done

                 

                 

                 

                else

                  TEMPLATE1=$END2END_TEMPLATE

                  TEMPLATE2=$HOSTING_TEMPLATE

                 

                 

                  PKG_NAME="COHERENCE_OBJECTGRID_UPDATE_${BUILD_VERSION}"

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                ####################CONFIG PACKAGES######################

                  PKG=($PKGS_LIST)

                  for PKGS in $PKG

                            do

                  if [ "$PKGS" = "DB_DEPLOYER" -o "$PKGS" = "POD_MIGRATION" -o "$PKGS" = "POD_CLIENT_SCRIPTS" -o "$PKGS" = "PORTAL" -o "$PKGS" = "COMP" -o "$PKGS" = "BATCH" ]

                   then

                   echo "Do Nothing As" $PKGS "is not Config"

                         else

                                 

                  PKG_NAME="TOMCAT_CONFIG_${PKGS}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                  fi

                  done

                 

                #############META PACKAGES######################

                for PKGS in $PKG

                  do

                  if [ "$PKGS" = "COMMON" ]

                  then

                           

                                  PKG_NAME="META_${PKGS}_${BUILD_VERSION}"

                   echo "Complete Package Name is"=$PKG_NAME

                   blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                   blcli_storeenv PACKAGE_KEY

                    blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                  else

                  if [ "$PKGS" = "DB_DEPLOYER" -o "$PKGS" = "POD_MIGRATION" -o "$PKGS" = "POD_CLIENT_SCRIPTS" ]

                  then

                  PKG_NAME="${PKGS}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                  else

                  if [ "$PKGS" = "PORTAL" -o "$PKGS" = "COMP" -o "$PKGS" = "BATCH" ]

                  then

                  echo "Do Nothing As" $PKGS "is not DB Section"

                  else

                  PKG_NAME="META_APP_${PKGS}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                  blcli_execute DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                  fi

                  fi

                  fi

                 

                  done

                 

                 

                ####################RPM SECTION#################################

                for PKGS in $PKG

                  do

                  if [ "$PKGS" = "PORTAL" -o "$PKGS" = "COMP" -o "$PKGS" = "BATCH" ]

                     then

                  PKG_NAME="TOMCAT_RPM_${PKGS}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                  DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                  

                  else

                  echo "Do Nothing As" $PKGS "is not RPM"

                  fi

                 

                  done

                 

                ##################APACHE PACKAGES###########################

                for apache in $APACHE_PKGS

                            do

                  if [ "$apache" = "$APACHE_STATIC_PKG" ]

                  then

                  PKG_NAME="${apache}_${BUILD_VERSION}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                  DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                  else

                  PKG_NAME="${apache}"

                  echo "Complete Package Name is"=$PKG_NAME

                  blcli_execute BlPackage getDBKeyByGroupAndName "${PACKAGE_LOCATION}" "${PKG_NAME}"

                  blcli_storeenv PACKAGE_KEY

                  DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                  DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                 

                  fi

                  done

                fi

                • 5. Re: applyAclTemplate is failing on depot object
                  Bill Robinson

                  except it's not being called like that - look in your script.  i see multiple sections that have the below:

                   

                  blcli_storeenv PACKAGE_KEY

                    DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE1" true

                    DepotObject applyAclTemplate "$PACKAGE_KEY" "$TEMPLATE2" false

                   

                  ...

                  • 6. Re: applyAclTemplate is failing on depot object

                    Thanks Bill,
                    I missed to add blcli_execute for few blocks thank you it is working fine now.