puppetlabs / support-script-analyzer

3 stars 3 forks source link

Error when Support script json files are not formatted correctly #1

Closed MartyEwings closed 3 years ago

MartyEwings commented 3 years ago

Describe the Bug

When running tech_check job against a support script, the following error is presented

./support_parse.sh tech_check  ../../Downloads/20201215121549-42237-puppet_enterprise_support_42237_************_20201215143936.tar.gz
jq: Bad JSON in --slurpfile server /var/folders/gn/b6dngf814l364m90lqty_hyc0000gq/T/tmp.ApCproyx/system/facter_output.json: Invalid numeric literal at line 1, column 11

facter_output.json can at times have non json formatting if debug is turned on

20-12-15 14:39:38.645199 DEBUG leatherman.execution:93 - executing command: lsb_release -a
2020-12-15 14:39:38.645249 DEBUG leatherman.execution:460 - lsb_release was not found on the PATH.
2020-12-15 14:39:38.645991 DEBUG puppetlabs.facter - fact "osfamily" has resolved to "RedHat".
2020-12-15 14:39:38.646038 DEBUG puppetlabs.facter - fact "operatingsystemmajrelease" has resolved to "7".
2020-12-15 14:39:38.646075 DEBUG puppetlabs.facter - fact "operatingsystemrelease" has resolved to "7.9".
2020-12-15 14:39:38.646112 DEBUG puppetlabs.facter - fact "hardwaremodel" has resolved to "x86_64".
2020-12-15 14:39:38.646148 DEBUG puppetlabs.facter - fact "architecture" has resolved to "x86_64".
2020-12-15 14:39:38.646184 DEBUG puppetlabs.facter - fact "operatingsystem" has resolved to "RedHat".
2020-12-15 14:39:38.646241 DEBUG puppetlabs.facter - fact "selinux" has resolved to false.
2020-12-15 14:39:38.646289 DEBUG puppetlabs.facter - fact "os" has resolved to {
  architecture => "x86_64",
  family => "RedHat",
  hardware => "x86_64",
  name => "RedHat",
  release => {
    full => "7.9",
    major => "7",
    minor => "9"