Esempio n. 1
0
def get_service_features():
    for service in FEATURES:
        for module in FEATURES[service]:
            module_features = {}
            cfg = os.path.join(constants.DATA_ROOT,
                               CONFIG_FILES[service][module])
            if not os.path.exists(cfg):
                continue

            for key in FEATURES[service][module]:
                for line in open(cfg).readlines():
                    ret = re.compile(
                        r"^{}\s*=\s*(.+)\s*".format(key)).match(line)
                    if ret:
                        module_features[key] = cli_helpers.bool_str(ret[1])
                        break

                if key not in module_features:
                    if key in DEFAULTS.get(service, {}).get(module, {}):
                        default = DEFAULTS[service][module][key]
                        module_features[key] = default

            # TODO: only include modules for which there is an actual agent
            #       installed since otherwise their config is irrelevant.
            if module_features:
                if service not in SERVICE_FEATURES:
                    SERVICE_FEATURES[service] = {}

                SERVICE_FEATURES[service][module] = module_features
Esempio n. 2
0
    def get_debug_log_info(self):
        debug_enabled = {}
        for proj in OST_PROJECTS:
            path = OST_ETC_OVERRIDES.get(proj)
            if path is None:
                path = os.path.join(constants.DATA_ROOT, "etc", proj,
                                    "{}.conf".format(proj))

            if os.path.exists(path):
                for line in cli_helpers.safe_readlines(path):
                    ret = re.compile(r"^debug\s*=\s*([A-Za-z]+).*").match(line)
                    if ret:
                        debug_enabled[proj] = cli_helpers.bool_str(ret[1])

        if debug_enabled:
            OPENSTACK_INFO["debug-logging-enabled"] = debug_enabled
Esempio n. 3
0
import os

from common import cli_helpers

# HOTSOS GLOBALS
DATA_ROOT = os.environ.get('DATA_ROOT', '/')
MASTER_YAML_OUT = os.environ.get('MASTER_YAML_OUT')
PLUGIN_TMP_DIR = os.environ.get('PLUGIN_TMP_DIR')
PLUGIN_NAME = os.environ.get('PLUGIN_NAME')
PART_NAME = os.environ.get('PART_NAME')
USE_ALL_LOGS = os.environ.get('USE_ALL_LOGS', "False")
if cli_helpers.bool_str(USE_ALL_LOGS):
    USE_ALL_LOGS = True
else:
    USE_ALL_LOGS = False
Esempio n. 4
0
import os
import re

from common import (
    checks,
    cli_helpers,
)
import openstack_exceptions

# Plugin config opts from global
OPENSTACK_AGENT_ERROR_KEY_BY_TIME = \
    cli_helpers.bool_str(os.environ.get('OPENSTACK_AGENT_ERROR_KEY_BY_TIME',
                                        'False'))
OPENSTACK_SHOW_CPU_PINNING_RESULTS = \
    cli_helpers.bool_str(os.environ.get('OPENSTACK_SHOW_CPU_PINNING_RESULTS',
                                        'False'))

# These are the names of Openstack projects we want to track.
OST_PROJECTS = [
    "aodh",
    "barbican",
    "ceilometer",
    "cinder",
    "designate",
    "glance",
    "gnocchi",
    "heat",
    "horizon",
    "keystone",
    "neutron",
    "nova",