fog / fog-xenserver

Module for the 'fog' gem to support XENSERVER
MIT License
16 stars 22 forks source link

collection.find is very slow and get_by_uuid is deprecated #43

Closed fmbiete closed 9 years ago

fmbiete commented 9 years ago

This code is very slow when used in a big pool +150 servers

connection.servers.find { |server| server.uuid == vm_uuid }

This method is a lot faster, but it's deprecated?

connection.servers.get_by_uuid(vm_uuid)

The shown message is pretty confusing:

[fog][DEPRECATION] This method is deprecated. Use #get_by_uuid instead.
plribeiro3000 commented 9 years ago

Are you sure are you using fog-xenserver and not fog itself?

If you take a look at this line you will see the method does not raise any warning and the request implementation here does not either.

In the main Fog gem this method is defined here and it calls the method get_vm_by_uuid that is raising the exception because it is deprecated.

Just use the fog-xenserver and you are good to go. LMK if it does not work for you. Thank!

fmbiete commented 9 years ago

OMG!!! silly me, xenserver module inside fog is not fog-xenserver... I have update my gemfile to include this, and the deprecation warning is gone.

Thanks!!

plribeiro3000 commented 9 years ago

You are welcome! That was kind of a lack of documentation issue.

We are going to remove the support in fog and add fog-xenserver as dependency soon. Until that try to use fog-xenserver instead. =)