WIP Refactor provider options - #503
Conversation
| script_path, | ||
| remote_script_path) | ||
|
|
||
| def _parse_cloudbase_init_plugins(self, plugins): |
There was a problem hiding this comment.
seems duplicated from #501, I assume that PR is the best location for this, no?
| }, | ||
| "description": "Cloudbase-Init plugin class names for Windows guests. When set, this list is written into the guest. When omitted, the provider plugin list is used, then coriolis.conf, then the Windows morphing default." | ||
| }, | ||
| "set_dhcp": { |
There was a problem hiding this comment.
Right, there is also nics_set_dhcp above. How does that interact with this?
| @@ -0,0 +1,54 @@ | |||
| # Copyright 2026 Cloudbase Solutions Srl | |||
There was a problem hiding this comment.
Right, coriolis/osmorphing/ mostly contains different target OSes, and I'd like to keep that as much as possible. I'd merge this and destination_options.py into coriolis/osmorphing/conf.py instead.
| @classmethod | ||
| def choices(cls, entry): | ||
| """Return allowed values for a registry entry.""" | ||
| handler = getattr(cls, "_choices_%s" % entry["name"], None) |
There was a problem hiding this comment.
I'd really rather not rely on this sort of magic too much. It makes the code a lot less grep-able. Why not just let overrides be overrides?
Also, as for the class name, there is no need to name it DestinationOptionOverrides, just let it be DestinationOptions, let providers override what they need to.
|
|
||
| @classmethod | ||
| def _choices_cloudbase_init_plugins(cls): | ||
| from coriolis.osmorphing import windows |
There was a problem hiding this comment.
move this import at the top level.
| def get_core_destination_option(name): | ||
| """Return the dest-options row for one registered core option.""" | ||
| for entry in CORE_DESTINATION_OPTIONS: | ||
| if entry["name"] == name: |
There was a problem hiding this comment.
why not use a dict at this point then?
3882774 to
b03c3c2
Compare
b03c3c2 to
d799e6f
Compare
No description provided.