Skip to content

WIP Refactor provider options - #503

Draft
Cristi1324 wants to merge 2 commits into
cloudbase:masterfrom
Cristi1324:refactor-target-options
Draft

WIP Refactor provider options#503
Cristi1324 wants to merge 2 commits into
cloudbase:masterfrom
Cristi1324:refactor-target-options

Conversation

@Cristi1324

Copy link
Copy Markdown
Contributor

No description provided.

script_path,
remote_script_path)

def _parse_cloudbase_init_plugins(self, plugins):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, there is also nics_set_dhcp above. How does that interact with this?

@@ -0,0 +1,54 @@
# Copyright 2026 Cloudbase Solutions Srl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use a dict at this point then?

@Cristi1324
Cristi1324 force-pushed the refactor-target-options branch from 3882774 to b03c3c2 Compare August 25, 2026 12:30
@Cristi1324
Cristi1324 force-pushed the refactor-target-options branch from b03c3c2 to d799e6f Compare August 25, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants