Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fog::Compute::Google::Disk attach_disk NoMethodError #610

Open
rchekaluk opened this issue Oct 25, 2023 · 0 comments
Open

Fog::Compute::Google::Disk attach_disk NoMethodError #610

rchekaluk opened this issue Oct 25, 2023 · 0 comments

Comments

@rchekaluk
Copy link

rchekaluk commented Oct 25, 2023

fog-google 1.22.0
fog-core 2.2.4
ruby 3.1.2p20

Running the attached snippet (redacted) for attaching a disk to a running instance, throws an error:

/usr/share/rvm/gems/ruby-3.1.2/gems/fog-google-1.22.0/lib/fog/compute/google/models/server.rb:280:in `attach_disk': undefined method `get_attached_disk' for   <Fog::Compute::Google::Disk (NoMethodError)
    name="fog-google-tester-data-1698268008",
    kind="compute#disk",
    id=REDACTED,
    creation_timestamp="2023-10-25T14:06:48.412-07:00",
    zone="https://www.googleapis.com/compute/v1/projects/REDACTED/zones/us-east4-a",
    status="READY",
    description="created with fog",
    size_gb=1,
    self_link="https://www.googleapis.com/compute/v1/projects/REDACTED/zones/us-east4-a/disks/fog-google-tester-data-1698268008",
    source_image=nil,
    source_image_id=nil,
    source_snapshot=nil,
    source_snapshot_id=nil,
    type="https://www.googleapis.com/compute/v1/projects/REDACTED/zones/us-east4-a/diskTypes/pd-standard",
    labels=nil,
    label_fingerprint="\\xE3e\\xA6J\\x90|\\xAD#",
    users=nil
  >:Fog::Compute::Google::Disk

            disk_obj = disk.get_attached_disk
                           ^^^^^^^^^^^^^^^^^^
Did you mean?  get_as_boot_disk
	from google-fog-attach_disk1.rb:39:in `<main>'

Running the alternate form of attach_disk:

resp = instance.attach_disk(datadisk_name, false)

throws a different error:

/usr/share/rvm/gems/ruby-3.1.2/gems/fog-google-1.22.0/lib/fog/compute/google/models/disks.rb:69:in `attached_disk_obj': wrong number of arguments (given 2, expected 1) (ArgumentError)
	from /usr/share/rvm/gems/ruby-3.1.2/gems/fog-google-1.22.0/lib/fog/compute/google/models/server.rb:282:in `attach_disk'
	from google-fog-attach_disk2.rb:39:in `<main>'

I am unclear if these errors are due to my incorrect usage of fog-google (could not find any usage examples), or if the gem is not feature-complete.

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

No branches or pull requests

1 participant