Method: Beaker::HostPrebuiltSteps#construct_env

Defined in:
lib/beaker/host_prebuilt_steps.rb

#construct_env(host, opts) ⇒ Hash

Create the hash of default environment from host (:host_env), global options hash (:host_env) and default PE/Foss puppet variables

Parameters:

  • host (Host)

    The host to construct the environment hash for, host specific environment should be in :host_env in a hash

  • opts (Hash)

    Hash of options, including optional global host_env to be applied to each provided host

Returns:

  • (Hash)

    A hash of environment variables for provided host



412
413
414
415
416
417
418
419
420
421
# File 'lib/beaker/host_prebuilt_steps.rb', line 412

def construct_env host, opts
  env = additive_hash_merge(host[:host_env], opts[:host_env])

  env.each_key do |key|
    separator = host['pathseparator']
    separator = ':' if key == 'PATH' && (not host.is_powershell?)
    env[key] = env[key].join(separator)
  end
  env
end