def register_from_packs(self, base_dirs):
        """
        Discover all the packs in the provided directory and register aliases from all of the
        discovered packs.

        :return: Tuple, Number of aliases registered, overridden.
        :rtype: ``tuple``
        """
        # Register packs first
        self.register_packs(base_dirs=base_dirs)

        registered_count = 0
        overridden_count = 0
        content = self._pack_loader.get_content(
            base_dirs=base_dirs, content_type="aliases"
        )

        for pack, aliases_dir in six.iteritems(content):
            if not aliases_dir:
                LOG.debug("Pack %s does not contain aliases.", pack)
                continue
            try:
                LOG.debug(
                    "Registering aliases from pack %s:, dir: %s", pack, aliases_dir
                )
                aliases = self._get_aliases_from_pack(aliases_dir)
                count, overridden = self._register_aliases_from_pack(
                    pack=pack, aliases=aliases
                )
                registered_count += count
                overridden_count += overridden
            except Exception as e:
                if self._fail_on_failure:
                    raise e

                LOG.exception(
                    "Failed registering all aliases from pack: %s", aliases_dir
                )

        return registered_count, overridden_count

        Discover all the packs in the provided directory and register aliases from all of the
        discovered packs.

        :return: Tuple, Number of aliases registered, overridden.
        :rtype: ``tuple``
        
st2common/st2common/bootstrap/aliasesregistrar.py