*Actual Behavior:* It fails because facter thinks both --external-facts and --no-external-facts have been specified:
{noformat} [2023-04-06 10:59:58.501545 ] ERROR Facter::OptionsValidator - no-external-facts and external-dir options conflict: please specify only one {noformat}
*Description*
A customer is seeing some unexpected behaviours when using facter as follows: * Using``{*}-p-{*}`` and ``{*}-no-external-facts{*}`` together produces an error ``{*}ERROR Facter::OptionsValidator - no-external-facts and external-dir options conflict: please specify only one{*}`` and no facts are returned * Other variations of facter options fail to return the expected custom fact
I have been able to replicate what the customer is seeing on my lab of {code}root@pe-server-238c28-1 development (development)$ facter --version 4.2.14 root@pe-server-238c28-1 development (development)$ {code}
More detail of my lab setup: * I have a custom fact defined on my PE, e.g., my environment containse the custom fact here *site-modules/bigbird/lib/facter/bigbird.rb* * I can see my ``bigbird`` custom fact as expected:
* However, when I introduce other flags I see expected results:
{code}# these work root@pe-server-238c28-1 development (development)$ facter -p --json | grep -E "(oslogin|[^/]bigbird)" "bigbird": { "oslogin": { root@pe-server-238c28-1 development (development)$ facter -p bigbird --json | grep -E "(oslogin|[^/]bigbird)" "bigbird": { root@pe-server-238c28-1 development (development)$
# these don't work # custom fact 'bigbird' is not returned unexpectedly root@pe-server-238c28-1 development (development)$ facter --json | grep -E "(oslogin|[^/]bigbird)" "oslogin": { root@pe-server-238c28-1 development (development)$
# no facts returned AND an error is thrown root@pe-server-238c28-1 development (development)$ facter -p --no-external-facts | grep -E "(oslogin|[^/]bigbird)" [2023-03-17 13:28:08.334765 ] ERROR Facter::OptionsValidator - no-external-facts and external-dir options conflict: please specify only one root@pe-server-238c28-1 development (development)$ facter -p --no-external-facts --json | grep -E "(oslogin|[^/]bigbird)" [2023-03-17 13:28:15.077332 ] ERROR Facter::OptionsValidator - no-external-facts and external-dir options conflict: please specify only one root@pe-server-238c28-1 development (development)$ facter -p bigbird --no-external-facts | grep -E "(oslogin|[^/]bigbird)" [2023-03-17 13:28:21.438824 ] ERROR Facter::OptionsValidator - no-external-facts and external-dir options conflict: please specify only one root@pe-server-238c28-1 development (development)$ facter -p bigbird --no-external-facts --json | grep -E "(oslogin|[^/]bigbird)" [2023-03-17 13:28:28.317694 ] ERROR Facter::OptionsValidator - no-external-facts and external-dir options conflict: please specify only one root@pe-server-238c28-1 development (development)$ {code}