Skip to content

Facter 2 output formatting#576

Closed
adrienthebo wants to merge 22 commits intopuppetlabs:masterfrom
adrienthebo:facter-2-output-formatting
Closed

Facter 2 output formatting#576
adrienthebo wants to merge 22 commits intopuppetlabs:masterfrom
adrienthebo:facter-2-output-formatting

Conversation

@adrienthebo
Copy link

This extracts the Facter command line formatting so that we can easily swap out the default format.

Question for the audience: do we want to change the output format of Facter to something more suitable to machine data, or should we leave it as-is?

Jeff McCune and others added 22 commits December 17, 2013 10:52
Without this patch there are a number of files that do not have
newlines.  This is a problem because it makes it difficult to use
`perl -pl -i -e ...`
Without this patch Ruby 1.9 is still complaining loudly about trying to parse
the spec files.

I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9.  This patch strives for a happy middle ground of
convincing Ruby it is actually working with Ruby while not confusing it to
think it should exec() to rspec.

This patch is the result of the following command run against the source tree:

    find spec -type f -print0 | \
      xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
Previously the test for checking that FACTER_* environment variables get
turned into facts was sensitive to the actual environment variables with
which the test ran. This caused incorrect test failures if there was
such an environment variable during the test run. This changes the
loader to be able to be given the environment hash that it should look
at and changes the tests to stop relying on the environment for testing.

Conflicts:
	spec/unit/util/loader_spec.rb
There were mocks for something called 'settings', which were never used.
This removes them.
This adds YARD documentation with `@api public` tags to the public API for
facter. This is a first pass, so it's probably missing some things that should
be considered public.

Conflicts:
	lib/facter/util/fact.rb
	lib/facter/util/resolution.rb
The only thing this file did was enable color.  This is a personal
preference, as is --fail-fast while using autotest.  It's a problem that
personal preferences can't be expressed without making the source dirty.
This patch fixes the problem my removing and ignoring the rspec file.

This patch also fixes a file not found exception in the watchr script
when the .rspec file does not exist.

Conflicts:
	.gitignore
Without this patch the documentation describing our workflow and process
is out of date for Facter.  This is a problem because community
contributors and people new to Puppet Labs have a more difficult time
learning how to submit contributions and merge contributions into the
codebase.

This patch addresses the problem by copying the COMMITTERS and
CONTRIBUTING documents from Puppet and customizing them specifically to
Facter.

[ci skip]
To prevent warnings. Both reader and writer are defined at line 417.
Confine OpenBSD, FreeBSD, and DragonFlyBSD ProcessorCount fact into a
single definition.
Literally, one misplaced space gone.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Facter.conf is not used anywhere in facter and has not been modified in the
entire git history of facter. This commit removes the file and directory to
reduce clutter.
In commit d091bf8, facter.conf and the etc
directory were removed from facter. This commit removes the references to the
etc directory from the osx file mapping file and ext/project_data.yaml, which
is used to build the gem and tarball. Without this commit building the gem or
tarball will fail trying to copy a nonexistent directory.
Move requires to top level, simplify how facts are sorted
This extracts facter's command line formatting to a separate file and
calls out plaintext formatting as a specific case. This allows us a
clean way of removing the plaintext behavior as we move towards
structured facts.
@adrienthebo
Copy link
Author

rrrrgh, wrong branch. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants