Skip to content

Unify NodeDriver functions#2170

Open
micafer wants to merge 6 commits into
trunkfrom
unify_create_node
Open

Unify NodeDriver functions#2170
micafer wants to merge 6 commits into
trunkfrom
unify_create_node

Conversation

@micafer

@micafer micafer commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Unify NodeDriver functions

Description

Many drivers overrides class NodeDriver functions in an incompatible manner ( #2133)
This PR tries to unify them using the function definition of the NodeDriver class.

Status

  • done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

@codecov-commenter

codecov-commenter commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.79880% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.57%. Comparing base (fe948d0) to head (b828f5a).
⚠️ Report is 2 commits behind head on trunk.

Files with missing lines Patch % Lines
libcloud/compute/drivers/cloudsigma.py 88.89% 1 Missing ⚠️
libcloud/compute/drivers/ec2.py 87.50% 1 Missing ⚠️
libcloud/compute/drivers/linode.py 90.00% 1 Missing ⚠️
libcloud/compute/drivers/maxihost.py 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk    #2170      +/-   ##
==========================================
+ Coverage   83.39%   83.57%   +0.18%     
==========================================
  Files         351      352       +1     
  Lines       81504    81747     +243     
  Branches     8747     8758      +11     
==========================================
+ Hits        67967    68314     +347     
+ Misses      10744    10561     -183     
- Partials     2793     2872      +79     
Files with missing lines Coverage Δ
libcloud/compute/drivers/abiquo.py 95.93% <100.00%> (ø)
libcloud/compute/drivers/azure.py 66.67% <100.00%> (ø)
libcloud/compute/drivers/azure_arm.py 60.73% <ø> (ø)
libcloud/compute/drivers/brightbox.py 97.59% <100.00%> (ø)
libcloud/compute/drivers/cloudscale.py 85.71% <100.00%> (ø)
libcloud/compute/drivers/cloudstack.py 75.12% <ø> (ø)
libcloud/compute/drivers/digitalocean.py 84.98% <100.00%> (+0.12%) ⬆️
libcloud/compute/drivers/dimensiondata.py 88.65% <ø> (ø)
libcloud/compute/drivers/dummy.py 37.50% <100.00%> (ø)
libcloud/compute/drivers/ecs.py 85.03% <ø> (ø)
... and 42 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@micafer

micafer commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@ChihweiLHBird could you take a look?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR standardizes a wide set of compute driver method signatures to follow the NodeDriver API (notably create_node(name, size, image, location=None, auth=None, ...)) to reduce incompatible overrides and IDE/type-checker warnings, and updates tests/docs/examples accordingly.

Changes:

  • Align many driver method signatures (node lifecycle, images, key pairs, volumes) with NodeDriver argument ordering and optionality.
  • Update unit tests to pass arguments using the standardized order / keyword arguments.
  • Add upgrade notes and changelog entries calling out the backward-incompatible impact for positional callers.

Reviewed changes

Copilot reviewed 55 out of 55 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
libcloud/test/compute/test_vcloud.py Updates create_node call to include standardized size argument.
libcloud/test/compute/test_vcl.py Updates create_node call to match standardized signature.
libcloud/test/compute/test_openstack.py Updates create_node test to explicitly pass image=None with new signature.
libcloud/test/compute/test_onapp.py Updates create_node test to pass size / image per standardized signature.
libcloud/test/compute/test_nttcis.py Updates many create_node calls to pass size=None per new signature.
libcloud/test/compute/test_linode_v4.py Updates create_node and create_volume call ordering to match standardized signatures.
libcloud/test/compute/test_gig_g8.py Updates create_node positional/keyword argument usage to match standardized signature.
libcloud/test/compute/test_gce.py Updates list_images call to use keyword args compatible with new signature.
libcloud/test/compute/test_ec2.py Updates copy_image call ordering to match standardized signature.
libcloud/test/compute/test_dimensiondata_v2_4.py Updates many create_node calls to pass size=None per new signature.
libcloud/test/compute/test_dimensiondata_v2_3.py Updates many create_node calls to pass size=None per new signature.
libcloud/test/compute/test_azure_arm.py Updates create_node calls to pass auth as a keyword in the standardized position.
libcloud/test/compute/test_abiquo.py Updates create_node calls to include standardized name/size arguments.
libcloud/compute/drivers/vultr.py Aligns Vultr driver signatures for sizes/images/nodes/volumes/keypairs with NodeDriver patterns.
libcloud/compute/drivers/vsphere.py Aligns vSphere signatures for sizes/images/nodes with standardized ordering and optional args.
libcloud/compute/drivers/vpsnet.py Aligns create_node signature with standardized ordering and optional args.
libcloud/compute/drivers/vcloud.py Aligns create_node signature and removes reliance on kwargs["name"] / kwargs["image"].
libcloud/compute/drivers/vcl.py Aligns create_node signature to the standard arguments (name/size/image first).
libcloud/compute/drivers/upcloud.py Aligns list_images/create_node signature optionality with NodeDriver.
libcloud/compute/drivers/scaleway.py Aligns sizes/images/node/volume/snapshot signatures with standardized ordering/optionality.
libcloud/compute/drivers/rimuhosting.py Makes location optional in create_node signature to match NodeDriver.
libcloud/compute/drivers/ovh.py Aligns create_node, volume creation, and key import signatures with standard ordering.
libcloud/compute/drivers/outscale.py Aligns Outscale signatures for node/image/volume operations with NodeDriver shapes.
libcloud/compute/drivers/openstack.py Aligns create_node, image create/delete, etc., with standardized naming/ordering.
libcloud/compute/drivers/opennebula.py Aligns create_node and attach_volume signatures with standard optional args.
libcloud/compute/drivers/onapp.py Aligns create_node and key deletion signatures with NodeDriver parameter names/order.
libcloud/compute/drivers/nttcis.py Aligns create_node signature to standard ordering with optional auth.
libcloud/compute/drivers/maxihost.py Aligns sizes/images/nodes/key creation signatures with standardized params.
libcloud/compute/drivers/linode.py Aligns list sizes/images, node creation, volume creation/attach, and image APIs with standard signatures.
libcloud/compute/drivers/kubevirt.py Aligns node/volume APIs (including snapshot args) with standardized method shapes.
libcloud/compute/drivers/ktucloud.py Adds auth=None to create_node to align with standard signature.
libcloud/compute/drivers/kamatera.py Makes location optional in list sizes/images and node creation signatures.
libcloud/compute/drivers/gridscale.py Aligns images/nodes/volume snapshot/image creation/attach signatures with standard patterns.
libcloud/compute/drivers/gig_g8.py Aligns node/sizes/images/volume APIs with standardized ordering and optional args.
libcloud/compute/drivers/gce.py Adds location=None to list_images and auth=None to create_node signature.
libcloud/compute/drivers/gandi.py Aligns deploy/node/volume APIs with standard ordering and optional args.
libcloud/compute/drivers/equinixmetal.py Aligns images/sizes/nodes and key APIs with standard ordering and optional args.
libcloud/compute/drivers/ecs.py Makes location optional in create_node signature to match NodeDriver.
libcloud/compute/drivers/ec2.py Aligns attach/copy/delete image APIs and sizes listing signature with standardized shapes.
libcloud/compute/drivers/dummy.py Adds optional location/auth to dummy create_node signature to match NodeDriver.
libcloud/compute/drivers/dimensiondata.py Aligns create_node signature to standard ordering with optional auth.
libcloud/compute/drivers/digitalocean.py Aligns images/nodes/image+key APIs and snapshot APIs with standardized signatures.
libcloud/compute/drivers/cloudstack.py Adds auth=None to create_node signature to match NodeDriver.
libcloud/compute/drivers/cloudsigma.py Aligns node/sizes/images/volume APIs and key pair retrieval signature with standard patterns.
libcloud/compute/drivers/cloudscale.py Aligns sizes/images and create_node signature with standard optional args.
libcloud/compute/drivers/brightbox.py Aligns create_node and list_sizes signature with standard optional args.
libcloud/compute/drivers/azure.py Aligns sizes/node/volume-related method signatures (including snapshot/device args) with NodeDriver patterns.
libcloud/compute/drivers/azure_arm.py Aligns create_node signature ordering (location/auth/rg) and attach_volume device arg.
libcloud/compute/drivers/abiquo.py Aligns create_node signature ordering with standard name/size/image first.
docs/upgrade_notes.rst Adds upgrade guidance noting the signature/order unification and positional-call breakage.
docs/examples/compute/vmware_vcloud_1.5.py Updates example create_node calls to include size=None per standardized signature.
docs/examples/compute/onapp/functionality.py Updates example to pass size=None / image=None per standardized signature.
docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py Updates example to use keyword args aligned with standardized create_node.
docs/development.rst Updates development docs to show standardized method signatures.
CHANGES.rst Adds changelog entry describing the cross-driver signature unification and compatibility impact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libcloud/compute/drivers/maxihost.py
Comment thread libcloud/compute/drivers/maxihost.py
Comment thread libcloud/compute/drivers/equinixmetal.py
Comment thread libcloud/compute/drivers/outscale.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants