A while back I wrote an OpenStack V3 API compute resource provider for
Foreman 1.11.0. It was actually fairly simple (I didn't write it as a
plugin/extension but modified the code in place; I know this isn't ideal
and will work on making it a plugin/extension).
However I want to validate that the code still works. Really all that was
needed was to drop in the provider code in
foreman/app/models/compute_resources/foreman/model/openstackv3.rb
module Foreman::Model
class OpenstackV3 < ComputeResource
attr_accessor :tenant
Then add the provider to the list of supported providers.
def self.supported_providers
{
'Libvirt' => 'Foreman::Model::Libvirt',
'Ovirt' => 'Foreman::Model::Ovirt',
'EC2' => 'Foreman::Model::EC2',
'Vmware' => 'Foreman::Model::Vmware',
'Openstack' => 'Foreman::Model::Openstack',
'OpenstackV3' => 'Foreman::Model::OpenstackV3',
'Rackspace' => 'Foreman::Model::Rackspace',
'GCE' => 'Foreman::Model::GCE'
}
However, when I do that on Foreman 1.13 I get
uninitialized constant Foreman::Model::OpenstackV3 (NameError)
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_hooks-0.3.12/lib/foreman_hooks.rb:90:in
`load_missing_constant_with_hooks'
/usr/share/foreman/app/models/concerns/fog_extensions.rb:54:in `<top
(required)>'
/opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in
`require'
/opt/rh/rh-ruby22/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in
`require'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/polyglot-0.3.4/lib/polyglot.rb:65:in
`require'
/usr/share/foreman/config/initializers/foreman.rb:12:in `<top (required)>
Which if I am understanding the error correctly means it can't find the
OpenstackV3 class.
In 1.11 the new provider code above was auto loaded/required, but this doesn't
appear to be happening in 1.13.
Any help would be appreciated.
Thanks
--
You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.