-
Notifications
You must be signed in to change notification settings - Fork 145
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
Problem With Fog::Compute::Google::InstanceGroups.add_instance Deprecation Warning #308
Comments
I was able to get rid of the deprecation warning by using the below method instead. I'll leave this issue open as I think there is still a chance that this could be a bug. Let me now what you think. |
@Temikus might know what's up here with more detail, but I'll give a pass at what I think is going on.
For now (until a add_instance is written), the following should work: env[:google_compute].instance_groups.get(instance_group_name, zone).add_instances([instance_name]) |
Sorry for the late response, I've been pretty much out of GitHub for the past 3 months for personal reasons. @seanmalloy Thanks for raising this. I've mimicked the AddInstances from the api, however, semantically, it's probably would've been better to keep @icco - Should I just add an alias then? |
@Temikus I think it needs to be a little more than an alias. Probably something like
|
Adding add_instance back to the model, seems I forgot to port it from the collection earlier. Fixes fog#308
Adding add_instance back to the model, seems I forgot to port it from the collection earlier. Fixes fog#308
I am using the latest code from the master branch. Git commit is c42060f.
I receive the below warning when adding a GCE instance to an unmanaged instance group.
I would like to not get this deprecation error, so I update my code to use
env[:google_compute].instance_group.add_instance
instead ofenv[:google_compute].instance_groups.add_instance
. Then I get the below NoMethodError exception.Looking through the code in the below file I do not see an
add_instance
method, but I do see a method namedadd_instances
.https://github.com/fog/fog-google/blob/master/lib/fog/compute/google/models/instance_group.rb#L36
It appears that the deprecation warning provides the wrong method name, and also that the class
Fog::Compute::Google::InstanceGroup
does not exist? I'm thinking this is a bug introduced in the 1.0 release or I am doing something wrong.Here is the specific code I used to get these errors.
https://github.com/KohlsTechnology/vagrant-google/blob/update-fog-google/lib/vagrant-google/action/assign_instance_groups.rb#L59-L63
I'm willing to submit a pull request to fix this if it is a bug, but I think I would need someone to point me in the right direction. Since this file exists
lib/fog/compute/google/models/instance_group.rb
I do not understand why the stack trace is happening.The text was updated successfully, but these errors were encountered: