Skip to content

Commit

Permalink
Adjusted peer related examples in regards to hostname -f versus sys.f…
Browse files Browse the repository at this point in the history
…qhost

This was breaking on some systems in a way that doesn't benefit the test.

Instead of assuming that `hostname -f` is equal to `sys.fqhost` just use `sys.fqhost` in the first place.

Ticket: ENT-12437
Changelog: none
  • Loading branch information
craigcomstock committed Nov 14, 2024
1 parent e5fa238 commit c75982b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/peerleader.cf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
#@ echo beta >> /tmp/cfe_hostlist
#@ echo gamma >> /tmp/cfe_hostlist
#@ echo "Set HOSTNAME appropriately beforehand"
#@ echo "$(hostname -f)" | tr 'A-Z' 'a-z' >> /tmp/cfe_hostlist
#@ touch $CFENGINE_TEST_OVERRIDE_WORKDIR/inputs/promises.cf # to enable cf-promises to run
#@ bash -c "${CF_PROMISES} --show-vars=sys.fqhost | grep fqhost | awk '{print \$2}' | tr 'A-Z' 'a-z' 2>&1 >> /tmp/cfe_hostlist"
#@ echo "Delta Delta Delta may I help ya help ya help ya"
#@ echo delta1 >> /tmp/cfe_hostlist
#@ echo delta2 >> /tmp/cfe_hostlist
Expand Down
3 changes: 2 additions & 1 deletion examples/peerleaders.cf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
#@ echo beta >> /tmp/cfe_hostlist
#@ echo gamma >> /tmp/cfe_hostlist
#@ echo "Set HOSTNAME appropriately beforehand"
#@ echo "$(hostname -f)" | tr 'A-Z' 'a-z' >> /tmp/cfe_hostlist
#@ touch $CFENGINE_TEST_OVERRIDE_WORKDIR/inputs/promises.cf # to enable cf-promises to run
#@ bash -c "${CF_PROMISES} --show-vars=sys.fqhost | grep fqhost | awk '{print \$2}' | tr 'A-Z' 'a-z' 2>&1 >> /tmp/cfe_hostlist"
#@ echo "Delta Delta Delta may I help ya help ya help ya"
#@ echo delta1 >> /tmp/cfe_hostlist
#@ echo delta2 >> /tmp/cfe_hostlist
Expand Down
4 changes: 3 additions & 1 deletion examples/peers.cf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
#@ echo beta >> /tmp/cfe_hostlist
#@ echo gamma >> /tmp/cfe_hostlist
#@ echo "Set HOSTNAME appropriately beforehand"
#@ echo "$(hostname -f)" | tr 'A-Z' 'a-z' >> /tmp/cfe_hostlist
#@ touch $CFENGINE_TEST_OVERRIDE_WORKDIR/inputs/promises.cf # to enable cf-promises to run
#@ bash -c "${CF_PROMISES} --show-vars=sys.fqhost | grep fqhost | awk '{print \$2}' | tr 'A-Z' 'a-z' 2>&1 >> /tmp/cfe_hostlist"
#@ echo "Delta Delta Delta may I help ya help ya help ya"
#@ echo delta1 >> /tmp/cfe_hostlist
#@ echo delta2 >> /tmp/cfe_hostlist
Expand Down Expand Up @@ -63,6 +64,7 @@ bundle agent peers
"/tmp/cfe_hostlist another leader $(all_leaders)";
"Unable to find my fully qualified hostname $(sys.fqhost) in /tmp/cfe_hostlist. Can't determine peers."
if => not( regline( $(sys.fqhost), "/tmp/cfe_hostlist" ) );
"/tmp/cfe_hostlist contains: ${with}" with => readfile("/tmp/cfe_hostlist");
}
#+end_src
###############################################################################
Expand Down

0 comments on commit c75982b

Please sign in to comment.