Hello!

My code is basically this commit

https://github.com/vide/facter/commit/c4060af48074c372a63409d81b836b79ff5d0427

This patch works smoothly if I overwrite the files in /usr/lib/ruby/vendor_ruby/

Then I've put those 4 files in

my_module/lib/facter/partitions.rb
my_module/lib/facter/util/partitions.rb
my_module/lib/facter/util/partitions/linux.rb
my_module/lib/facter/util/partitions/openbsd.rb

they are copied through pluginsync and they are *completely* ignored.
Then, if I add the "has_weight 100" line to
my_module/lib/facter/partitions.rb then at least I get this error

Could not retrieve fact='partitions', resolution='<anonymous>':
undefined method `label' for Facter::Util::Partitions:Module
/var/lib/puppet/lib/facter/partitions.rb:31:in `block (3 levels) in
<top (required)>'
/var/lib/puppet/lib/facter/partitions.rb:26:in `each'
/var/lib/puppet/lib/facter/partitions.rb:26:in `block (2 levels) in
<top (required)>'
/usr/lib/ruby/vendor_ruby/facter/util/resolution.rb:157:in `call'
/usr/lib/ruby/vendor_ruby/facter/util/resolution.rb:157:in `resolve_value'
/usr/lib/ruby/vendor_ruby/facter/core/resolvable.rb:63:in `block (2
levels) in value'
/usr/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/usr/lib/ruby/vendor_ruby/facter/core/resolvable.rb:62:in `block in value'
/usr/lib/ruby/vendor_ruby/facter/core/resolvable.rb:84:in `with_timing'
/usr/lib/ruby/vendor_ruby/facter/core/resolvable.rb:61:in `value'
/usr/lib/ruby/vendor_ruby/facter/util/fact.rb:161:in `block in
find_first_real_value'
/usr/lib/ruby/vendor_ruby/facter/util/fact.rb:160:in `each'
/usr/lib/ruby/vendor_ruby/facter/util/fact.rb:160:in `find_first_real_value'
/usr/lib/ruby/vendor_ruby/facter/util/fact.rb:113:in `block in value'
/usr/lib/ruby/vendor_ruby/facter/util/fact.rb:145:in `searching'
/usr/lib/ruby/vendor_ruby/facter/util/fact.rb:110:in `value'
/usr/lib/ruby/vendor_ruby/facter/util/collection.rb:130:in `value'
/usr/lib/ruby/vendor_ruby/facter.rb:117:in `value'
/usr/lib/ruby/vendor_ruby/facter/application.rb:37:in `block in run'
/usr/lib/ruby/vendor_ruby/facter/application.rb:35:in `each'
/usr/lib/ruby/vendor_ruby/facter/application.rb:35:in `run'
/usr/bin/facter:20:in `<main>'


Anyway I'm attaching the fact that is giving me this error. The error
is thrown by

# facter -p  --yaml partitions --trace

Thanks!

On Mon, Jan 12, 2015 at 1:03 AM, Felix Frank
<[email protected]> wrote:
> On 01/09/2015 03:48 PM, Davide Ferrari wrote:
>
> Hi
>
> I'm trying to override a fact from facter 2.3, called "partitions"
> with a custom version of this fact, via pluginsync.
>
> The problem is that the base file in
> /var/lib/puppet/lib/facter/partitions.rb, just like it's facter
> brother in /usr/lib/ruby/vendor_ruby/facter/partitions.rb has a
>
> require 'facter/util/partitions'
>
> and this require seems to me that, no matter what I do, try to
> includes other ruby files from /usr/lib/ruby/vendor_ruby/ and not
> /var/lib/puppet/lib/, even if I run facter -p.
>
> What's the correct way to override via pluginsync an already existing
> and complex fact like "partitions" ? I'm already specifying
> "has_weigth 100" in /var/lib/puppet/lib/facter/partitions.rb because
> otherwise it wouldn't even consider my custom version, but it stops
> there.
>
> Thanks!
>
>
> Hi,
>
> I've done similar things with older versions of Facter. It should work.
>
> Can you share your code, the result, and what you expect to happen?
>
> Thanks,
> Felix
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/54B30F5D.3070005%40Alumni.TU-Berlin.de.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAKsfaEaTcpsmV3%3DhUNRr_i9dSCxcd8fE%3DdfdNSHZk6s8CYFcHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: partitions_fact_modified.tar.gz
Description: GNU Zip compressed data

Reply via email to