On 02/20, Koper, Dies wrote:
> Hi David,
>
> > > + set :capability, lambda { |t| true }
> >
> > Is this intentional/still needed to avoid the problems that you were
> > seeing ? If it's meant to stay here, it needs a big FIXME comment;
> > without a proper capability check, system_templates will be advertised
> > for any driver.
>
> I'll change it to check for the system_templates operation in the driver.
> I think my idea was that system_templates would be supported for all drivers
> using the DB, but as I haven't included any DB support, I'll change it.
>
> > > + set :capability, lambda { |m| driver.respond_to? m }
> >
> > IIRC, this is the capability check that was giving you trouble - is this
> > working now for you ?
>
> Yes it was. It is still not working for me. Still hoping Michal will look at
> it and figure it out.
I still have no idea what is wrong here. I can see 'systems' in CEP on
1.9.3 MRI and also on 1.8.7 MRI. Also we did small debugging with Dies to
find out what coulb be possibly wrong.
set :capability, lambda { |m| puts "#{m}:#{driver.respond_to? m}"; true }
If you do this in systems_collection.rb and then you query CEP you should
see the method:true/false here. The 'method' should be value of the
':with_capability' option defined for the 'index' operation.
However Dies reporting 'system_volumes:false' here but he not used
'system_volumes' as value for :with_capability in collection.
For me, it reports 'systems:true' (the :with_capability => :systems) and
the 'systems' method is properly defined.
It is still mystery for me, but I suggest to upgrade Ruby to 1.9 and see if
this is still a problem.
Also note, that we are not doing anything smart around capabilities
checking. We just pass the lamda to rabbit, rabbit executes it and generate
412 error if return value is 'false'.
-- Michal
--
Michal Fojtik <[email protected]>
Deltacloud API, CloudForms