Пример #1
0
    def discover(self, driver, host, **data):
        client = driver.client(host)

        process = find_python_process(client, 'cinder-volume')
        if not process:
            return None

        cinder_volume = CinderVolumeComponent()
        cinder_volume.host_id = get_host_id(client)

        cinder_volume.process = collect_process(client, process)

        cinder_volume.version = find_python_package_version(client, 'cinder')

        collect_component_configs(
            client, cinder_volume, process.command,
            default_config='/etc/cinder/cinder.conf')

        config_dir = '/etc/cinder'
        if len(cinder_volume.config_files) > 0:
            config_dir = os.path.dirname(cinder_volume.config_files[0].path)

        rootwrap_config_path = path_relative_to(
            cinder_volume.config['rootwrap_config'], config_dir)
        cinder_volume.rootwrap_config = collect_file(
            client, rootwrap_config_path)

        self._seen_items.append(cinder_volume)

        return cinder_volume
Пример #2
0
    def discover(self, driver, host, **data):
        client = driver.client(host)

        process = find_python_process(client, 'nova-api')
        if not process:
            return None

        nova_api = NovaApiComponent()
        nova_api.host_id = get_host_id(client)
        nova_api.listen_sockets = get_process_listen_sockets(client,
                                                             process.pid)
        nova_api.version = find_python_package_version(client, 'nova')

        collect_component_configs(
            client, nova_api, process.command,
            default_config='/etc/nova/nova.conf')

        config_dir = '/etc/nova'
        if len(nova_api.config_files) > 0:
            config_dir = os.path.dirname(nova_api.config_files[0].path)

        paste_config_path = path_relative_to(
            nova_api.config['api_paste_config'], config_dir)
        nova_api.paste_config_file = collect_file(
            client, paste_config_path)

        self._seen_items.append(nova_api)

        return nova_api
Пример #3
0
    def discover(self, driver, host, **data):
        client = driver.client(host)

        process = find_python_process(client, 'cinder-api')
        if not process:
            return None

        cinder_api = CinderApiComponent()
        cinder_api.host_id = get_host_id(client)

        cinder_api.process = collect_process(client, process)

        cinder_api.version = find_python_package_version(client, 'cinder')

        collect_component_configs(
            client, cinder_api, process.command,
            default_config='/etc/cinder/cinder.conf')

        config_dir = '/etc/cinder'
        if len(cinder_api.config_files) > 0:
            config_dir = os.path.dirname(cinder_api.config_files[0].path)

        paste_config_path = path_relative_to(
            cinder_api.config['api_paste_config'], config_dir)
        cinder_api.paste_config_file = collect_file(
            client, paste_config_path)

        self._seen_items.append(cinder_api)

        return cinder_api
Пример #4
0
    def _collect_cinder_volume_data(self, client):
        process = self._find_python_process(client, 'cinder-volume')
        if not process:
            return None

        cinder_volume = CinderVolumeComponent()
        cinder_volume.version = self._find_python_package_version(
            client, 'cinder')

        self._collect_component_configs(
            client,
            cinder_volume,
            process[1:],
            default_config='/etc/cinder/cinder.conf')

        config_dir = '/etc/cinder'
        if len(cinder_volume.config_files) > 0:
            config_dir = os.path.dirname(cinder_volume.config_files[0].path)

        rootwrap_config_path = path_relative_to(
            cinder_volume.config['rootwrap_config'], config_dir)
        cinder_volume.rootwrap_config = self._collect_file(
            client, rootwrap_config_path)

        return cinder_volume
Пример #5
0
    def _collect_cinder_api_data(self, client):
        process = self._find_python_process(client, 'cinder-api')
        if not process:
            return None

        cinder_api = CinderApiComponent()
        cinder_api.version = self._find_python_package_version(
            client, 'cinder')

        self._collect_component_configs(
            client,
            cinder_api,
            process[1:],
            default_config='/etc/cinder/cinder.conf')

        config_dir = '/etc/cinder'
        if len(cinder_api.config_files) > 0:
            config_dir = os.path.dirname(cinder_api.config_files[0].path)

        paste_config_path = path_relative_to(
            cinder_api.config['api_paste_config'], config_dir)
        cinder_api.paste_config_file = self._collect_file(
            client, paste_config_path)

        return cinder_api
Пример #6
0
    def _collect_nova_api_data(self, client):
        process = self._find_python_process(client, 'nova-api')
        if not process:
            return None

        nova_api = NovaApiComponent()
        nova_api.version = self._find_python_package_version(client, 'nova')

        self._collect_component_configs(
            client, nova_api, process[1:],
            default_config='/etc/nova/nova.conf')

        config_dir = '/etc/nova'
        if len(nova_api.config_files) > 0:
            config_dir = os.path.dirname(nova_api.config_files[0].path)

        paste_config_path = path_relative_to(
            nova_api.config['api_paste_config'], config_dir)
        nova_api.paste_config_file = self._collect_file(
            client, paste_config_path)

        return nova_api
Пример #7
0
    def discover(self, driver, host, **data):
        client = driver.client(host)

        process = find_python_process(client, 'nova-api')
        if not process:
            return None

        nova_api = NovaApiComponent()
        nova_api.host_id = get_host_id(client)

        nova_api.process = collect_process(client, process)

        nova_api.version = find_python_package_version(client, 'nova')

        collect_component_configs(
            client, nova_api, process.command,
            default_config='/etc/nova/nova.conf')

        config_dir = '/etc/nova'
        if len(nova_api.config_files) > 0:
            config_dir = os.path.dirname(nova_api.config_files[0].path)

        for param in nova_api.config.schema:
            if param.type == 'file':
                path = nova_api.config[param.name]
                driver.enqueue('file', host=host, path=path)
            elif param.type == 'directory':
                path = nova_api.config[param.name]
                driver.enqueue('directory', host=host, path=path)

        paste_config_path = path_relative_to(
            nova_api.config['api_paste_config'], config_dir)
        nova_api.paste_config_file = collect_file(
            client, paste_config_path)

        self._seen_items.append(nova_api)

        return nova_api
Пример #8
0
    def _collect_cinder_volume_data(self, client):
        process = self._find_python_process(client, 'cinder-volume')
        if not process:
            return None

        cinder_volume = CinderVolumeComponent()
        cinder_volume.version = self._find_python_package_version(client,
                                                                  'cinder')

        self._collect_component_configs(
            client, cinder_volume, process[1:],
            default_config='/etc/cinder/cinder.conf')

        config_dir = '/etc/cinder'
        if len(cinder_volume.config_files) > 0:
            config_dir = os.path.dirname(cinder_volume.config_files[0].path)

        rootwrap_config_path = path_relative_to(
            cinder_volume.config['rootwrap_config'], config_dir)
        cinder_volume.rootwrap_config = self._collect_file(
            client, rootwrap_config_path)

        return cinder_volume
Пример #9
0
    def _collect_cinder_api_data(self, client):
        process = self._find_python_process(client, 'cinder-api')
        if not process:
            return None

        cinder_api = CinderApiComponent()
        cinder_api.version = self._find_python_package_version(client,
                                                               'cinder')

        self._collect_component_configs(
            client, cinder_api, process[1:],
            default_config='/etc/cinder/cinder.conf')

        config_dir = '/etc/cinder'
        if len(cinder_api.config_files) > 0:
            config_dir = os.path.dirname(cinder_api.config_files[0].path)

        paste_config_path = path_relative_to(
            cinder_api.config['api_paste_config'], config_dir)
        cinder_api.paste_config_file = self._collect_file(
            client, paste_config_path)

        return cinder_api
Пример #10
0
    def _collect_nova_api_data(self, client):
        process = self._find_python_process(client, 'nova-api')
        if not process:
            return None

        nova_api = NovaApiComponent()
        nova_api.version = self._find_python_package_version(client, 'nova')

        self._collect_component_configs(client,
                                        nova_api,
                                        process[1:],
                                        default_config='/etc/nova/nova.conf')

        config_dir = '/etc/nova'
        if len(nova_api.config_files) > 0:
            config_dir = os.path.dirname(nova_api.config_files[0].path)

        paste_config_path = path_relative_to(
            nova_api.config['api_paste_config'], config_dir)
        nova_api.paste_config_file = self._collect_file(
            client, paste_config_path)

        return nova_api