fog / fog-google

Fog for Google Cloud Platform
MIT License
99 stars 146 forks source link

Fog::Compute::Google::Disks#get disk users remain after detach #611

Closed rchekaluk closed 7 months ago

rchekaluk commented 8 months ago

Detaching an attached disk does not update the users list in its Fog::Compute::Google::Disk object:

    server.detach_disk(device_name, false)
    disk.reload
    assert disk.users.nil? || disk.users == []

This is because reloading the disk object (fog-core Fog::Model#reload) merges its prior attributes with newly retrieved attributes; in a detached disk, the newly-retrieved attributes omit :users key, thus its prior value is retained.