tuned icon indicating copy to clipboard operation
tuned copied to clipboard

Allow dynamic instances of non-hotplug plugins

Open adriaan42 opened this issue 1 month ago • 0 comments

Split off #628 for easier review and discussion.

This removes the checks for "is the plugin of type hotplug.Plugin" from instance_create and instance_destroy, while keeping the rest of the code in controller.py as-is. To do this, some of the device related methods need noop-implementations in base.Plugin.

Notes:

  • base.Plugin seems to implement some device methods with actual logic (assign_free_devices, release_devices, _run_for_each_device, _call_device_script, _*_device_commands). Why are those not in hotplug.Plugin?
  • In create_instance, we could add checking and warnings if the user creates a base.Plugin instance and sets the devices= or devices_udev_regex= options. At the moment these options would be ignored silently (which is also ok I guess).

adriaan42 avatar Jan 21 '25 15:01 adriaan42