def _register_pack(self, pack_name, pack_dir):
        """
        Register a pack and corresponding pack config schema (create a DB object in the system).

        Note: Pack registration now happens when registering the content and not when installing
        a pack using packs.install. Eventually this will be moved to the pack management API.
        """
        # 1. Register pack
        pack_db = self._register_pack_db(pack_name=pack_name, pack_dir=pack_dir)

        # Display a warning if pack contains deprecated config.yaml file. Support for those files
        # will be fully removed in v2.4.0.
        config_path = os.path.join(pack_dir, "config.yaml")
        if os.path.isfile(config_path):
            LOG.error(
                'Pack "%s" contains a deprecated config.yaml file (%s). '
                'Support for "config.yaml" files has been deprecated in StackStorm v1.6.0 '
                "in favor of config.schema.yaml config schema files and config files in "
                "/opt/stackstorm/configs/ directory. Support for config.yaml files has "
                "been removed in the release (v2.4.0) so please migrate. For more "
                "information please refer to %s "
                % (
                    pack_db.name,
                    config_path,
                    "https://docs.stackstorm.com/reference/pack_configs.html",
                )
            )

        # 2. Register corresponding pack config schema
        config_schema_db = self._register_pack_config_schema_db(
            pack_name=pack_name, pack_dir=pack_dir
        )

        return pack_db, config_schema_db

        Register a pack and corresponding pack config schema (create a DB object in the system).

        Note: Pack registration now happens when registering the content and not when installing
        a pack using packs.install. Eventually this will be moved to the pack management API.
        
st2common/st2common/bootstrap/base.py