Git Product home page Git Product logo

fog-vcloud-director's People

Contributors

agrare avatar bancek avatar gberginc avatar jrafanie avatar miha-plesko avatar

Watchers

 avatar  avatar  avatar

fog-vcloud-director's Issues

Drop support for `:InstantiationParams` in vApp instantiation request

We once supported the old format of passing instantiation parameters which strictly followed the XML elements structure. But with this PR we provide support for a much more intuitive way of providing those parametes, via :networks.

This issue stands as a reminder that legacy support should be removed in the future.

options[:source_vms] is required but not documented as such to instantiate a template

options[:source_vms].each_with_index { |_, i| options[:source_vms][i][:href] = vapp_template_vm_end_point(options[:source_vms][i].delete(:vm_id)) if options[:source_vms][i].has_key?(:vm_id) }

^ That line is executed no matter what, so if you do something like this as the documentation suggests:

template.instantiate('webserver', {
  vdc_id: "9a06a16b-12c6-44dc-aee1-06aa52262ea3",
  network_id: "d5f47bbf-de27-4cf5-aaaa-56772f2ccd17"
}

You will get an error such as this:

NoMethodError: undefined method `each_with_index' for nil:NilClass
...

I am guessing the best fix for this will be to add this code in the populate_uris method in the same source file:

          options[:endpoint] = end_point
          options[:source_vms] = [] unless options.key?(:source_vms)
          options
        end

Or something similar so that field always exists at generation time, even if the consumer does not set it, as when there is only one VM in the vApp.

Uninitialized constant Fog::Compute::VcloudDirector::VappTemplate in 0.2.0

Backstory:
Hi, when I rebased my core ManageIQ repo to the latest I see certain failure when indexing our STI. Digging deep I found out it's caused by update of this gem to version 0.2.0 in ManageIQ/manageiq-providers-vmware@41b450f , before this commit everything works flawlessly.

Description:
When updated to 0.2.0 my setup fails to import fog/vcloud_director at all:

require 'fog/vcloud_director'
NameError: uninitialized constant Fog::Compute::VcloudDirector::VappTemplate
Did you mean?  Fog::Compute::VcloudDirector::VappTemplates
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director/models/compute/vapp_templates.rb:10:in `<class:VappTemplates>'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director/models/compute/vapp_templates.rb:6:in `<class:VcloudDirector>'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director/models/compute/vapp_templates.rb:5:in `<module:Compute>'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director/models/compute/vapp_templates.rb:4:in `<module:Fog>'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director/models/compute/vapp_templates.rb:3:in `<top (required)>'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director.rb:13:in `block in <top (required)>'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director.rb:13:in `each'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director.rb:13:in `<top (required)>'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `require'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
        from /home/______/.rbenv/versions/2.4.4/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from (irb):1
        from /home/______/.rbenv/versions/2.4.4/bin/irb:11:in `<main>'

It fails using both rails c console and irb. Any idea what can be causing it?

Also note that the vapp_template.rb is present in .../gems/fog-vcloud-director-0.2.0/lib/fog/vcloud_director/models/compute/, but it's obviously not resolved properly.

Environment:

  • ruby 2.4.4
  • rbenv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.