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

Preview report can't process a catalog_preview that has debugging enabled #4

Open
hpcprofessional opened this issue Jul 26, 2016 · 0 comments

Comments

@hpcprofessional
Copy link

catalog_preview has a --debug option

If this option is used, it populates the output with data such as:

^[[0;36mDebug: Evicting cache entry for environment 'development'^[[0m
^[[0;36mDebug: Caching environment 'development' (ttl = 0 sec)^[[0m
^[[0;36mDebug: Evicting cache entry for environment 'development'^[[0m
^[[0;36mDebug: Caching environment 'development' (ttl = 0 sec)^[[0m
^[[0;36mDebug: Evicting cache entry for environment 'development'^[[0m
^[[0;36mDebug: Caching environment 'development' (ttl = 0 sec)^[[0m
^[[0;36mDebug: Evicting cache entry for environment 'development'^[[0m
^[[0;36mDebug: Caching environment 'development' (ttl = 0 sec)^[[0m
^[[0;36mDebug: Using settings: adding file resource 'confdir': 'File[/etc/puppetlabs/puppet]{:path=>"/etc/puppetlabs/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'^[[0m

(note the ASCII color codes)

This is also reproducible if one has perfectly valid json output but puts a comment at the top line:

#No comments in JSON!
{
  "stats": {
...

Anyway, it would be a nice bonus feature if the script could ignore stuff until it encountered JSON, at which point it would start to process the json and then explode if it had any subsequent parse errors.

Alternately, it could just error out and say "$file is not valid JSON."

Dealer's choice. (Right now it explodes with a stack trace)

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

No branches or pull requests

1 participant