Skip to content

guard against searching for VMs with id nil - #315

Merged
stejskalleos merged 2 commits into
fog:masterfrom
stejskalleos:ls/include_safe_guard
Oct 14, 2025
Merged

guard against searching for VMs with id nil#315
stejskalleos merged 2 commits into
fog:masterfrom
stejskalleos:ls/include_safe_guard

Conversation

@stejskalleos

@stejskalleos stejskalleos commented Oct 8, 2025

Copy link
Copy Markdown
Collaborator
  • get_virtual_machine - Raise a NotFound error when id is nil
  • Compute::Server - only fetch SCSI and NVMe controllers when id is not nil

@stejskalleos

Copy link
Copy Markdown
Collaborator Author

The failing Ruby / test (head) (pull_request) is an issue in the shindo gem for unreleased Ruby version (3.5-dev), not related to the changes in the PR.

Comment thread lib/fog/vsphere/requests/compute/get_virtual_machine.rb Outdated
@stejskalleos
stejskalleos force-pushed the ls/include_safe_guard branch from b9b0ea2 to e84a9f4 Compare October 10, 2025 11:13
@stejskalleos stejskalleos changed the title get_vm_by_name - safe guard for nil :name get_virtual_machine - Raise an error when id is nil Oct 10, 2025
@stejskalleos
stejskalleos force-pushed the ls/include_safe_guard branch from e84a9f4 to b545484 Compare October 10, 2025 11:31
Comment thread lib/fog/vsphere/version.rb
@stejskalleos
stejskalleos force-pushed the ls/include_safe_guard branch from b545484 to 2c26809 Compare October 14, 2025 08:33
@stejskalleos

Copy link
Copy Markdown
Collaborator Author

added id.nil? to *_controllers methods.

@evgeni evgeni 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.

I think the summary of this PR should be more like:

guard against searching for VMs with id nil

- get_virtual_machine - Raise a NotFound error when id is nil
- Compute::Server - only fetch SCSI and NVMe controllers when id is not nil

other than that: ACK

- get_virtual_machine - Raise a NotFound error when id is nil
- Compute::Server - only fetch SCSI and NVMe controllers when id is not nil
@stejskalleos
stejskalleos force-pushed the ls/include_safe_guard branch from 2c26809 to cba0fa2 Compare October 14, 2025 10:39
@stejskalleos stejskalleos changed the title get_virtual_machine - Raise an error when id is nil guard against searching for VMs with id nil Oct 14, 2025
@stejskalleos

Copy link
Copy Markdown
Collaborator Author

PR & commit message updated

@stejskalleos
stejskalleos merged commit f0f8808 into fog:master Oct 14, 2025
4 of 5 checks passed
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