コード例 #1
0
    def get_all(self):
        host_facts = {}

        firmware_collector = firmware_info.FirmwareCollector(
            prefix=self.prefix,
            testing=self.testing,
        )
        firmware_info_dict = firmware_collector.get_all()

        virt_collector = virt.VirtCollector(
            prefix=self.prefix,
            testing=self.testing,
            collected_hw_info=firmware_info_dict)
        virt_collector_info = virt_collector.get_all()

        cloud_collector = cloud_facts.CloudFactsCollector(
            prefix=self.prefix,
            testing=self.testing,
            collected_hw_info=firmware_info_dict)
        cloud_facts_info = cloud_collector.get_all()

        host_facts.update(cloud_facts_info)
        host_facts.update(virt_collector_info)
        host_facts.update(firmware_info_dict)

        locale_info = {}
        effective_locale = 'Unknown'
        # When there is no locale set (system variable LANG is unset),
        # then this is value returned by locale.getdefaultlocale()
        # Tuple contains: (language[_territory], encoding identifier)
        default_locale = (None, None)
        try:
            default_locale = locale.getdefaultlocale()
        except ValueError as err:
            log.warning(
                "Unable to get default locale (bad environment variable?): %s"
                % err)
        if default_locale[0] is not None:
            effective_locale = ".".join([_f for _f in default_locale if _f])
        locale_info['system.default_locale'] = effective_locale
        host_facts.update(locale_info)

        # Now, munging, kluges, special cases, etc
        # NOTE: we are passing the facts we've already collected into
        # cleanup_collector.
        cleanup_collector = cleanup.CleanupCollector(
            prefix=self.prefix,
            testing=self.testing,
            collected_hw_info=host_facts)
        cleanup_info = cleanup_collector.get_all()

        host_facts.update(cleanup_info)
        return host_facts
コード例 #2
0
    def get_all(self):
        host_facts = {}
        hardware_collector = hwprobe.HardwareCollector(prefix=self.prefix,
                                                       testing=self.testing)
        hardware_info = hardware_collector.get_all()

        firmware_collector = firmware_info.FirmwareCollector(
            prefix=self.prefix,
            testing=self.testing,
        )
        firmware_info_dict = firmware_collector.get_all()

        virt_collector = virt.VirtCollector(
            prefix=self.prefix,
            testing=self.testing,
            collected_hw_info=firmware_info_dict)
        virt_collector_info = virt_collector.get_all()

        host_facts.update(hardware_info)
        host_facts.update(virt_collector_info)
        host_facts.update(firmware_info_dict)

        default_rhsm_dir = rhsm.config.DEFAULT_CONFIG_DIR.rstrip('/')
        custom_facts_dir = os.path.join(default_rhsm_dir, self.facts_sub_dir)
        path_and_globs = [(custom_facts_dir, self.facts_glob)]

        custom_facts = custom.CustomFactsCollector(
            prefix=self.prefix,
            testing=self.testing,
            path_and_globs=path_and_globs)
        custom_facts_dict = custom_facts.get_all()
        host_facts.update(custom_facts_dict)

        locale_info = {}
        locale_info['system.default_locale'] = ".".join(
            locale.getdefaultlocale())
        host_facts.update(locale_info)

        # Now, munging, kluges, special cases, etc
        # NOTE: we are passing the facts we've already collected into
        # cleanup_collector.
        cleanup_collector = cleanup.CleanupCollector(
            prefix=self.prefix,
            testing=self.testing,
            collected_hw_info=host_facts)
        cleanup_info = cleanup_collector.get_all()

        host_facts.update(cleanup_info)
        return host_facts
コード例 #3
0
    def get_all(self):
        host_facts = {}
        hardware_collector = hwprobe.HardwareCollector(
            prefix=self.prefix,
            testing=self.testing
        )
        hardware_info = hardware_collector.get_all()

        firmware_collector = firmware_info.FirmwareCollector(
            prefix=self.prefix,
            testing=self.testing,
        )
        firmware_info_dict = firmware_collector.get_all()

        virt_collector = virt.VirtCollector(
            prefix=self.prefix,
            testing=self.testing,
            collected_hw_info=firmware_info_dict
        )
        virt_collector_info = virt_collector.get_all()

        host_facts.update(hardware_info)
        host_facts.update(virt_collector_info)
        host_facts.update(firmware_info_dict)

        locale_info = {}
        effective_locale = 'Unknown'
        if locale.getdefaultlocale()[0] is not None:
            effective_locale = ".".join(filter(None, locale.getdefaultlocale()))
        locale_info['system.default_locale'] = effective_locale
        host_facts.update(locale_info)

        # Now, munging, kluges, special cases, etc
        # NOTE: we are passing the facts we've already collected into
        # cleanup_collector.
        cleanup_collector = cleanup.CleanupCollector(
            prefix=self.prefix,
            testing=self.testing,
            collected_hw_info=host_facts
        )
        cleanup_info = cleanup_collector.get_all()

        host_facts.update(cleanup_info)
        return host_facts