Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-1653

External Facts from PowerShell do not parse structured output (JSON/YAML)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: FACT 3.6.5, FACT 3.9.2
    • Fix Version/s: FACT 3.6.9, FACT 3.9.4
    • Component/s: None
    • Labels:
    • Template:
    • Acceptance Criteria:
      • Acceptance test for this behaviour on a Windows Server 2012R2 (or later) OS
    • Team:
      Platform OS
    • Story Points:
      2
    • Sprint:
      Platform OS 2017-10-31, Platform OS Kanban
    • Method Found:
      Customer Feedback
    • CS Priority:
      Major
    • CS Frequency:
      4 - 50-90% of Customers
    • CS Severity:
      2 - Annoyance
    • CS Business Value:
      4 - $$$$$
    • CS Impact:
      Most customers have at least some windows nodes. While the workaround for this is annoying rather than severe is contributes to the perception that windows is not a first class part of our ecosystem.
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Allows YAML or JSON output from external facts written in powershell to be interpreted as structured facts
    • QA Risk Assessment:
      Needs Assessment

      Description

      The powershell resolver in facter for external facts seems to treat all text as key=value pairs only. However Powershell can trivially output JSON (or YAML) too for structured facts

      Can facter please be updated to parse JSON/YAML text.

      Example PS code to emit JSON

      Write-Output (@{ 'key1' = 'value1'; 'key2' = 'value2' } | ConvertTo-JSON -Depth 1 -Compress)
      

      Note - Requires Windows Server 2012R2 (PowerShell 3) for ConvertTo-JSON for testing

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              branan Branan Riley
              Reporter:
              glenn.sarti Glenn Sarti
              Votes:
              6 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support