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

regression on overidding external facts (shell)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: FACT 3.6.3, FACT 3.6.5
    • Fix Version/s: FACT 3.6.7, FACT 3.9.0
    • Component/s: CLI
    • Labels:
    • Environment:

      OS : RedHat 7.2, RedHat 6.5
      Puppet : puppet-agent-1.10.4 (puppet 4.10.4) puppet-agent-1.10.0 (puppet 4.10.1)

    • Template:
    • Acceptance Criteria:
      Hide

      FACTER_ext_fact=overidded_fact facter ext_fact
      must return : overidded_fact

      Show
      FACTER_ext_fact=overidded_fact facter ext_fact must return : overidded_fact
    • Team:
      Platform OS
    • Story Points:
      1
    • Sprint:
      Platform OS 2017-08-09, Platform OS 2017-08-22, Platform OS 2017-09-05
    • Method Found:
      Customer Feedback
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Fixes a regression in facter 3.6.3 that did not honor overriding an external fact with an environment variable.
    • QA Risk Assessment:
      Automate

      Description

      overidding shell external facts (facts.d) using shell variable FACTER_fact does not work anymore. (is working with puppet 3.8.5)

      1. cat /tmp/puppet/facts.d/ext_fact.sh
        #!/bin/ksh -p
        echo "ext_fact=from_script"
      1. FACTER_ext_fact=overrided_fact facter --verbose --external-dir /tmp/puppet/facts.d ext_fact
        2017-07-17 17:06:31.350418 INFO puppetlabs.facter - executed with command line: --verbose --external-dir /tmp/puppet/facts.d ext_fact.
        2017-07-17 17:06:31.358085 INFO leatherman.ruby:138 - ruby loaded from "/opt/puppetlabs/puppet/lib/libruby.so.2.1.0".
        2017-07-17 17:06:31.493467 INFO leatherman.ruby:187 - using ruby version 2.1.9
        2017-07-17 17:06:31.493609 INFO puppetlabs.facter - requested queries: ext_fact.
        from_script
      1. FACTER_ext_fact=overrided_fact puppet facts --debug --vardir=/tmp/puppet/ find . |grep ext_fact
        Debug: Facter: checking execution on /tmp/puppet/facts.d/ext_fact.sh
        Debug: Facter: resolving facts from executable file "/tmp/puppet/facts.d/ext_fact.sh".
        Debug: Facter: executing command: /tmp/puppet/facts.d/ext_fact.sh
        Debug: Facter: ext_fact=from_script
        Debug: Facter: fact "ext_fact" has resolved to "from_script".
        Debug: Facter: completed resolving facts from executable file "/tmp/puppet/facts.d/ext_fact.sh".
        Debug: Facter: setting fact "ext_fact" based on the value of environment variable "FACTER_ext_fact".
        Debug: Facter: fact "ext_fact" has changed from "from_script" to "overrided_fact".
        Warning: Facter: getgrgid_r failed: Numerical result out of range (34)
        "ext_fact": "from_script",

      The debug output shows : Debug: Facter: fact "ext_fact" has changed from "from_script" to "overrided_fact".
      but in reality the fact is not overidden by the value overrided_fact

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            fjouvanceau Franck Jouvanceau
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support