acceptance/lib/pxp-agent/bolt_pxp_module_helper.rb
# Selects only the agents (not masters) from a set of beaker hosts and produces an array of PCP
# identity strings for them.
#
# @param targets [Array<Beaker::Host>] The hosts
# @return [Array<String>] PCP broker identities of the agent hosts only
Selects only the agents (not masters) from a set of beaker hosts and produces an array of PCP
identity strings for them.
Selects only the agents ( not masters ) from a set of beaker hosts and produces an array of PCP identity strings for them .
def agent_identities(targets)
  agents_only = targets.reject { |host| host['roles'].include?('master') }.to_a
  agents_only.map { |agent| "pcp://#{agent}/agent" }
end
def agent_identities ( targets ) agents_only = targets . reject { | host | host [ 'roles' ] . include? ( 'master' ) } . to_a agents_only . map { | agent | "pcp://#{agent}/agent" } end
Selects only the agents (not masters) from a set of beaker hosts and produces an array of PCP
identity strings for them.
Selects only the agents ( not masters ) from a set of beaker hosts and produces an array of PCP identity strings for them .
# Select the hosts that have the agent role but not the master role (Beaker's # `agents` selector selects all of the hosts that have the agent role, but masters # typically have _both_ the agent and master roles - this rejection guards against # accidentally including the master in this list when working with `agents`).
PCP broker identities of the agent hosts only
PCP broker identities of the agent hosts only
Array<String>
targets
None