Skip to content

Commit

Permalink
(BKR-1559) Do not mirror profile.d on Debian
Browse files Browse the repository at this point in the history
This mirroring is not needed since directly executed SSH commands ignore
profile.d. This means it's sufficient to set ~/.ssh/environment.

The format is another issue with this function. In ~/.ssh/environment
it'll be PATH=PATH:/opt/puppetlabs/bin but this breaks the PATH in an
actual shell.

This only removes it on Debian because I've verified that works and I
don't have any SLES-based machines nor knowledge.
  • Loading branch information
ekohl committed Dec 17, 2018
1 parent 0d993d8 commit bc8e52e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/beaker/host/unix/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def ping target, attempts=5
end

# Converts the provided environment file to a new shell script in /etc/profile.d, then sources that file.
# This is for sles and debian based hosts.
# This is for sles based hosts.
# @param [String] env_file The ssh environment file to read from
def mirror_env_to_profile_d env_file
if self[:platform] =~ /sles-|debian/
if self[:platform] =~ /sles-/
@logger.debug("mirroring environment to /etc/profile.d on sles platform host")
cur_env = exec(Beaker::Command.new("cat #{env_file}")).stdout
shell_env = ''
Expand All @@ -89,7 +89,7 @@ def mirror_env_to_profile_d env_file
exec(Beaker::Command.new("source #{self[:profile_d_env_file]}"))
else
#noop
@logger.debug("will not mirror environment to /etc/profile.d on non-sles/debian platform host")
@logger.debug("will not mirror environment to /etc/profile.d on non-sles platform host")
end
end

Expand Down

0 comments on commit bc8e52e

Please sign in to comment.