Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup - enhancements! #47

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Fixup - enhancements! #47

wants to merge 7 commits into from

Conversation

trlinkin
Copy link

@trlinkin trlinkin commented Jan 4, 2017

Some general changes for the tool to make output more instantly useful. Also, now it can load catalogs on Puppet 4, so thats cool I guess.

This commit adds a new, more intelligent formatter method for consuming
identified parameter differences between the catalogs. This formatter
tries to show values side by side for simple comparison. This formatter
is a basic first attempt and will be enhanced later.
Without this commit, the "differ" was not using functional routines that
would correctly consume catalogs from disk. Methods like `from_pson` are
no longer available. The "differ" also has implicit code for reading
'.json' extensions despite not having it documented that they were
valid.

This commit removes the ability to attempt to handle JSON catalogs. When
it comes to PSON catalogs, it will use the appropriate and verified
working method available in Puppet 4.

This commit also sorts some of the results of the "diffing" process for
cleaner presentation later.
Without this commit, the "diff" face had a few different problems. The
simple ones were a matter of unreadable code. The more important issue
was the lazy method by which data coming out of the "differ" was
formatted and presented.

This commit starts by re-tabbing the whole document. The lines trying to
output to the console were also difficult to read and a bit of a mess.
They were split out into a more usable form.

This commit also takes advantage of the new method of presenting
parameter differences that has been added to the formatter.
The code that sends the differ output off to be formatted takes a
somewhat simple approach of treating data generically. To present the
param diff data in a more usable manner, a purpose specific method has
been created. We need to make sure this method gets used instead of the
generic formatting approach for this data. Right now the approach taken
for keeping that data from going through the generic method is wrong. A
lack of understanding since the code is sort of dense.

This commit ensures that the param data not be passed through the
generic formatting loop. It also ensures that the param data that gets
passed is actually coming from the correct place.
This commit ensures that the output generated by the param diff
formatter. This commit also corrects an issue where the name of the
resource in question was not being passed correctly.
This commit enables the presentation of resources in "diff" format as a
default. The command line flag "display_resource_diff" has been changed
to "no_resource_diff" to be used to disable the behavior.
This commit adds back the code for loading PSON files and JSON files in
Puppet 3.x. It also ensures that the correct loading method is used
between 3.x and 4.x versions of Puppet. In Puppet 4.x it raises an error
when trying to load JSON catalogs. There was not an obvious method for
loading these files that could be found, additionally a JSON catalog
could not be found to test with.
@raphink
Copy link

raphink commented May 6, 2020

Nice changes in there. If you're still interested, would you mind rebasing them against https://github.com/camptocamp/puppet-catalog-diff ?

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.

2 participants