fog / fog-vsphere

Fog for vSphere
MIT License
36 stars 63 forks source link

Unable to load Fog::Vsphere::Compute #182

Closed serj1408 closed 5 years ago

serj1408 commented 5 years ago

How to avoid these type of warnings? It used to work and I can't find any new format documentation. Or is it a bug?

require 'fog/vsphere'
credentials = {
    :provider=>"vsphere",
    :vsphere_username=>ENV['VCENTER_USERNAME'],
    :vsphere_password=>ENV['VCENTER_PASSWORD'],
    :vsphere_server=>"xxxxx",
    :vsphere_expected_pubkey_hash => "xxxxx"
}
compute = Fog::Compute.new(credentials)

[fog][DEPRECATION] Unable to load Fog::Vsphere::Compute
[fog][DEPRECATION] The format Fog::Compute::Vsphere is deprecated

Ruby version 2.1.3

    fog-core (2.1.2)
      builder
      excon (~> 0.58)
      formatador (~> 0.2)
      mime-types
    fog-vsphere (2.5.0)
      fog-core
      rbvmomi (~> 1.9)
timogoebel commented 5 years ago

This might be due to a change in fog-core. I believe we need to change our code to use autoload, similar to https://github.com/fog/fog-digitalocean/commit/5a023b40ee971529e2d3d5b8fb27869f5fb01934.

@chris1984: We have seen this in Foreman as well, so we should take care of this. Better sooner than later ;-)

tarcinil commented 5 years ago

@chris1984 - Have you completed any work on this? Any issues with me making an attempt at it?

timogoebel commented 5 years ago

cc: @ares, @ezr-ondrej

chris1984 commented 5 years ago

@tarcinil have at it

ezr-ondrej commented 5 years ago

@tarcinil I would do what @timogoebel suggested and move to the autoload structure of the project. Have you done anything yet? Or should I do it?

tarcinil commented 5 years ago

@ezr-ondrej I have not started the work but that was my plan. I was planning on starting my work tonight and having something reviewable by the weekend.

ezr-ondrej commented 5 years ago

If you'll give me about an hour, I'll produce testable version of that (WIP PR), I am finishing the testing. So you can base on that. I will move the files and give it some spins to see if it is not marginally broken.

ezr-ondrej commented 5 years ago

After bit of an investigation I beleive the prefered way is the oposite of what digitalocean did. And I believe the finite answer is: https://github.com/fog/fog-core/blob/master/spec/compute_spec.rb.

ares commented 5 years ago

Hello, we plan to bump fog in Foreman core soon, how far are we from having this ready? Thanks.

ezr-ondrej commented 5 years ago

I believe, that @timogoebel agrees with the change and the PR is close to merging, but it is quite a big change, so it is up to him, how confident he is with merging.

timogoebel commented 5 years ago

I just merged the PR, will release 3.0.0 in the next couple of minutes.