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

        :return: Number of sensors registered, overridde
        :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="sensors"
        )

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

                LOG.exception(
                    'Failed registering all sensors from pack "%s": %s',
                    sensors_dir,
                    six.text_type(e),
                )

        return registered_count, overridden_count

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

        :return: Number of sensors registered, overridde
        :rtype: ``tuple``
        
st2common/st2common/bootstrap/sensorsregistrar.py