Unify NodeDriver functions#2170
Conversation
Codecov Report❌ Patch coverage is 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
🚀 New features to boost your workflow:
|
|
@ChihweiLHBird could you take a look? |
There was a problem hiding this comment.
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
NodeDriverargument 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.
| def create_image( | ||
| self, | ||
| node, | ||
| name, | ||
| description=None, | ||
| ): | ||
| """Creates a private image from a LinodeDisk. | ||
| Images are limited to three per account. | ||
|
|
||
| :param disk: LinodeDisk to create the image from (required) | ||
| :type disk: :class:`LinodeDisk` | ||
| :param node: LinodeDisk to create the image from (required) | ||
| :type node: :class:`LinodeDisk` |
There was a problem hiding this comment.
Technically the node should be a Node class... but in Linode this is complicated because every node can have multiple config profiles for booting different disks and the disk is required for image creation API call, and there isn't a very obvious way to determine which config profile or disk booted the node most recently... I guess we can have this called node but typed with LinodeDisk for now. I can look into the way to fully resolve it in the future
I don't think these are blockers, but worth noting for future work. |
Unify NodeDriver functions
Description
Many drivers overrides class
NodeDriverfunctions in an incompatible manner ( #2133)This PR tries to unify them using the function definition of the
NodeDriverclass.Status
Checklist (tick everything that applies)