Foreman-one plugin, restart development

Hello,

I'm interested in getting the foreman-one plugin back to a working state.
Since I will be using Foreman and OpenNebule closely together I really
could use this plugin.

With the current versions of Foreman the released foreman-one plugin (0.2)
is useless since it not up to date.

After a bit of googling I've found this repo
https://github.com/b0e/foreman-one and that gets me a lot further; I've
created a rpm with the latest version of the gem from that tree and
instaleld it. Now I'm able to edit a Compute Profile without any errors.
But saving it still gives me an error:

> Started POST "/compute_profiles/1-1-Small/compute_attributes" for
10.68.26.11 at 2015-11-06 15:36:29 +0100
2015-11-06 15:36:29 [app] [I] Processing by
ComputeAttributesController#create as HTML
2015-11-06 15:36:29 [app] [I] Parameters: {"utf8"=>"✓",
"authenticity_token"=>"ys5rue/5FEH+XCPwIKT1VOdOQEqFHAshqEYJ6IOmAHY=",
"compute_attribute"=>{"vm_attrs"=>{"template_id"=>"0", "vcpu"=>"", "me
mory"=>"", "gid"=>"0", "interfaces"=>{"vnetid"=>"", "_delete"=>"1",
"model"=>"virtio"}}, "compute_profile_id"=>"1",
"compute_resource_id"=>"1"}, "compute_profile_id"=>"1-1-Small"}
2015-11-06 15:36:29 [sql] [I] Successfully decrypted field for
ForemanOne::One DAP-OpenNebula
2015-11-06 15:36:29 [app] [W] Action failed
> NoMethodError: undefined method vm_description' for #<Fog::Compute::OpenNebula::Server:0x007f100daecee0> > /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/object/try.rb:36:intry'
> /usr/share/foreman/app/models/compute_attribute.rb:29:in
pretty_vm_attrs' > /usr/share/foreman/app/models/compute_attribute.rb:35:inupdate_name'

This looks like there is something missing in the Fog? The rest of the
installation is a standard Foreman 1.9.3 on CentOS 7.

I'm willing to help with testing and debugging. So just let me know what
else I need to test or to update.

Thanks,
Tim

> Hello,
>
> I'm interested in getting the foreman-one plugin back to a working
> state. Since I will be using Foreman and OpenNebule closely together I
> really could use this plugin.
>
> With the current versions of Foreman the released foreman-one plugin
> (0.2) is useless since it not up to date.
>
> After a bit of googling I've found this repo
> https://github.com/b0e/foreman-one and that gets me a lot further; I've
> created a rpm with the latest version of the gem from that tree and
> instaleld it. Now I'm able to edit a Compute Profile without any errors.
> But saving it still gives me an error:
>
> > Started POST "/compute_profiles/1-1-Small/compute_attributes" for
> 10.68.26.11 at 2015-11-06 15:36:29 +0100
> 2015-11-06 15:36:29 [app] [I] Processing by
> ComputeAttributesController#create as HTML
> 2015-11-06 15:36:29 [app] [I] Parameters: {"utf8"=>"✓",
> "authenticity_token"=>"ys5rue/5FEH+XCPwIKT1VOdOQEqFHAshqEYJ6IOmAHY=",
> "compute_attribute"=>{"vm_attrs"=>{"template_id"=>"0", "vcpu"=>"", "me
> mory"=>"", "gid"=>"0", "interfaces"=>{"vnetid"=>"", "_delete"=>"1",
> "model"=>"virtio"}}, "compute_profile_id"=>"1",
> "compute_resource_id"=>"1"}, "compute_profile_id"=>"1-1-Small"}
> 2015-11-06 15:36:29 [sql] [I] Successfully decrypted field for
> ForemanOne::One DAP-OpenNebula
> 2015-11-06 15:36:29 [app] [W] Action failed
> > NoMethodError: undefined method `vm_description' for
> #<Fog::Compute::OpenNebula::Server:0x007f100daecee0>
>
> This looks like there is something missing in the Fog? The rest of the
> installation is a standard Foreman 1.9.3 on CentOS 7.

It's something we actually extend Fog with inside Foreman.

Here's an example from another plugin:
https://github.com/theforeman/foreman-digitalocean/blob/master/app/models/concerns/fog_extensions/digitalocean/server.rb#L10
https://github.com/theforeman/foreman-digitalocean/blob/master/lib/foreman_digitalocean/engine.rb#L25-L31
(loader)

Or from Libvirt in core:
https://github.com/theforeman/foreman/blob/develop/app/models/concerns/fog_extensions/libvirt/server.rb#L32

It's a method that provides a high level text description of a compute
profile contents.

Actually, it looks like you can add it into the server.rb file added in
this commit:
https://github.com/b0e/foreman-one/commit/067635ab62f4ac00645836892ee90e7d14355916

> I'm willing to help with testing and debugging. So just let me know what
> else I need to test or to update.

Perhaps if we can get a series of changes that work, we can merge b0e's
branch and your extra fixes back into the canonical version under
theforeman. I'm one of the people with access to the rubygem, so would
be happy to help you get those changes released and packaged. (This is
part of the idea about keeping it under theforeman, that we can revive
projects!)

··· On 06/11/15 14:55, Tim Verhoeven wrote:


Dominic Cleal
dominic@cleal.org