Skip to content

fix: correct netplan renderer target#6465

Merged
aciba90 merged 1 commit into
canonical:mainfrom
aciba90:fix-integration-tests
Sep 12, 2025
Merged

fix: correct netplan renderer target#6465
aciba90 merged 1 commit into
canonical:mainfrom
aciba90:fix-integration-tests

Conversation

@aciba90
Copy link
Copy Markdown
Contributor

@aciba90 aciba90 commented Sep 11, 2025

Proposed Commit Message

fix: correct netplan renderer target

Only pass absolute path to netplan python API if an explicit target is passed to netplan.Renderer.render_network_state. That is, when called from cloud-init net-convert.

Additional Context

https://github.com/canonical/cloud-init/actions/runs/17638202988/job/50118871293

Test Steps

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

Only pass absolute path to netplan python API if an explicit target is
passed to netplan.Renderer.render_network_state. That is, when called
from cloud-init net-convert.
Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

LGTM @aciba90!. Thanks for the correction here and paying attention to the newly degraded integration tests. Minor nit about one-liner. Your call about what you think is more readable.

Comment thread cloudinit/net/netplan.py
Comment on lines +399 to +402
if target is None:
target_ = target
else:
target_ = fpnplan
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this one-liner readable enough or is its behavior too convoluted?

Suggested change
if target is None:
target_ = target
else:
target_ = fpnplan
target_ = None if target is None else fpnplan

+1 either way I can see the integration tests succeeding with this PR.

@aciba90 aciba90 merged commit f626daa into canonical:main Sep 12, 2025
21 checks passed
@aciba90 aciba90 deleted the fix-integration-tests branch September 12, 2025 10:22
gauravmishragit663 added a commit to gauravmishragit663/cloud-init that referenced this pull request Sep 12, 2025
blackboxsw pushed a commit to blackboxsw/cloud-init that referenced this pull request Nov 17, 2025
Only pass absolute path to netplan python API if an explicit target is
passed to netplan.Renderer.render_network_state. That is, when called
from cloud-init net-convert.
blackboxsw pushed a commit to blackboxsw/cloud-init that referenced this pull request Dec 3, 2025
Only pass absolute path to netplan python API if an explicit target is
passed to netplan.Renderer.render_network_state. That is, when called
from cloud-init net-convert.
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