Landscape Sysinfo plugins do not support custom python packages

Bug #2029212 reported by Harsha Narayana
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Landscape Client hard codes the sysinfo plugin extension path while discovering the plugins. This makes it hard to inject plugins that are part of custom python packages. It would be really cool if the plugins could support some mechanism by which one can specify a fully qualified python Class name that implements the plugin requirements. This will also simplify extending the plugins using custom python packages.

```python
    def get_plugins(self):
        if self.sysinfo_plugins is None:
            include = ALL_PLUGINS
        else:
            include = self.get_plugin_names(self.sysinfo_plugins)
        if self.exclude_sysinfo_plugins is None:
            exclude = []
        else:
            exclude = self.get_plugin_names(self.exclude_sysinfo_plugins)
        plugins = [x for x in include if x not in exclude]
        return [
            namedClass(
                f"landscape.sysinfo.{plugin_name.lower()}.{plugin_name}",
            )()
            for plugin_name in plugins
        ]
```

Right now, we can use `sysinfo_plugins` to configure the list of plugins, it would be nice to extend this and add a `sysinfo_custom_plugins` and let this accept a python package qualified class name like below.

```conf
sysinfo_custom_plugins = mypackage.subpackage.plugins.MySysInfo
```

summary: - Landscape Sysinfo Plugins do not support custom python packages
+ Landscape Sysinfo plugins do not support custom python packages
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in landscape-client (Ubuntu):
status: New → Confirmed
Revision history for this message
Mitch Burton (mitchburton) wrote :

This is a great ask and it's something I've thought about a lot myself. I don't see any reason not to do it, so consider it road-mapped, though with no set timeline (yet).

Changed in landscape-client (Ubuntu):
assignee: nobody → Mitch Burton (mitchburton)
assignee: Mitch Burton (mitchburton) → nobody
Revision history for this message
Harsha Narayana (harshnar) wrote :

Thanks for the quick feedback Mitch. Glad to have you onboard with this idea. I would be more than happy to put this feature into a PR and send it for review. let me know if there is a design process/documentation that needs to be done before we can open a pull request

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.