Closed israelriibeiro closed 9 years ago
@israelriibeiro We need to keep compatibility between the old api. See here: https://github.com/fog/fog/blob/master/lib/fog/xenserver/models/compute/server.rb#L242
Also, you just renamed the require, but not the file name.
@plribeiro3000 I explained to @israelriibeiro about api compatibility, you're totally right
The request on XenServer is Vm.revert, but checking the server.rb I got you deprecated revert in favor of revert_to, any special reason why use revert_to instead of xenserver default request?
ty
about renaming the require but not the file, exists both revert_server.rb and revert_to_server.rb requests, he should have added revert_to instead of replacing the line
I switched it in the beggining of the extraction from the main fog gem. I can't really remember why but i think we should move to the Xenserver api and deprecate if necessary. This codebase is at beta so don't worry about breaking apis within.
great... we are going to handle all this, keeping the compatibility with xenserver api
Closing due inactivity. Comment in here if you are willing to play with this again.
Hi, @plribeiro3000 . If i keep compatibility would it be correct? If you say yes, i'll correct it now.
Yes. But don't worry about compatibility now. Just make it be like XENSERVER api. Use revert
instead of revert_to
.
But i guess you will need to update more then just this file.
@plribeiro3000 , i tested using my master, which is without revert_to_server in requests. I found this:
irb(main):014:0> vm.revert conn.snapshots.get_by_name('teste_snapshot').reference
[fog][DEPRECATION] This method is DEPRECATED. Use #revert_to instead.
NoMethodError: undefined method revert_to_vm' for #<Fog::Compute::XenServer::Real:0x007fbb03c74c80> from /Users/zertico/Documents/fog-xenserver/lib/fog/compute/xen_server/models/server.rb:168:in
revert_to'
from /Users/zertico/Documents/fog-xenserver/lib/fog/compute/xen_server/models/server.rb:163:in revert' from (irb):14 from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli/console.rb:38:in
run'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli.rb:287:in console' from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/command.rb:27:in
run'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/invocation.rb:121:in invoke_command' from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor.rb:363:in
dispatch'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/base.rb:440:in start' from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli.rb:9:in
start'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/bin/bundle:20:in block in <top (required)>' from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/friendly_errors.rb:5:in
with_friendly_errors'
from /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/bin/bundle:20:in <top (required)>' from /opt/boxen/rbenv/versions/2.1.2/bin/bundle:23:in
load'
from /opt/boxen/rbenv/versions/2.1.2/bin/bundle:23:in `
I re-added revert to requests and manage to revert a snapshot. But, like you said, maybe i need to change more than that. Maybe, i think, it would be easier to open an issue. If you could guide me on this, i'll apreciated.
@israelriibeiro You gonna have to:
revert_to_server
I just found the issue related here. 093788035655d62c3d8ecf705da046c8288b7732 is introducing the request revert
when a revert_to
were already created and tested.
You gonna have to remove those tests as well.
I think this might be all.
@israelriibeiro Just let me know when this is ready. This pr is floating for a long time already.
@israelriibeiro Thank you for your interest in doing this but this issue was already solved at the version 0.1.2
.
I noticed that in server.rb(1), line 168, you used revert_to_vm( alias_method to revert_to_server), but the request in xen_server.rb(2) was revert_server. Change it, because you said that revert will be deprecate.
https://github.com/fog/fog-xenserver/blob/master/lib/fog/compute/xen_server/models/server.rb#L168 https://github.com/fog/fog-xenserver/blob/master/lib/fog/compute/xen_server.rb#L283