package-testing/lib/pdk/pdk_helper.rb
# NOTE: currently there is an issue with beaker's create_tmpdir_on helper on cygwin
# and OSX platforms:  the `chown` command always fails with an error about not
# recognizing the Administrator:Administrator user/group.  Also, the call to
# check user presence via `getent` also fails. Until this is fixed, we add this
# shim that delegates to a non-`chown`/non-`getent`-executing version for the
# purposes of our test setup.
#
# TODO: fix via: https://tickets.puppetlabs.com/browse/BKR-496
currently there is an issue with beaker's create_tmpdir_on helper on cygwin
and OSX platforms:  the `chown` command always fails with an error about not
recognizing the Administrator:Administrator user/group.  Also, the call to
check user presence via `getent` also fails. Until this is fixed, we add this
shim that delegates to a non-`chown`/non-`getent`-executing version for the
purposes of our test setup.


currently there is an issue with beaker ' s create_tmpdir_on helper on cygwin and OSX platforms : the ` chown ` command always fails with an error about not recognizing the Administrator : Administrator user / group . Also the call to check user presence via ` getent ` also fails . Until this is fixed we add this shim that delegates to a non - ` chown ` / non - ` getent ` - executing version for the purposes of our test setup .
def tmpdir_on(hosts, path_prefix = '', user = nil)
  first_host = Array(hosts).first
  return create_tmpdir_on(hosts, path_prefix, user) unless \
    first_host.is_cygwin? || first_host.platform =~ %r{osx}
  block_on hosts do |host|
    unless user
      user = host['user']
    end
    raise 'Host platform not supported by `tmpdir_on`.' unless defined? host.tmpdir
    host.tmpdir(path_prefix)
  end
end
def tmpdir_on ( hosts , path_prefix = '' , user = nil ) first_host = Array ( hosts ) . first return create_tmpdir_on ( hosts , path_prefix , user ) unless first_host . is_cygwin? || first_host . platform =~ %r{ osx } block_on hosts do | host | unless user user = host [ 'user' ] end raise 'Host platform not supported by `tmpdir_on`.' unless defined? host . tmpdir host . tmpdir ( path_prefix ) end end
NOTE: currently there is an issue with beaker's create_tmpdir_on helper on cygwin
and OSX platforms:  the `chown` command always fails with an error about not
recognizing the Administrator:Administrator user/group.
NOTE : currently there is an issue with beaker ' s create_tmpdir_on helper on cygwin and OSX platforms : the ` chown ` command always fails with an error about not recognizing the Administrator : Administrator user / group .
# use default user logged into this host
hosts
path_prefix
user