kitchen-puppet 1.46.2 → 1.46.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b50b0b38f7d949f0d3e44755a61dbb0da1241e2
4
- data.tar.gz: e7669336277eeaa4c5d480d1006c8528b78bde3f
3
+ metadata.gz: 453a104e476a43094a963f5395d69e4654efe766
4
+ data.tar.gz: 88bb2dde065c442d9c8658004f5802b277434530
5
5
  SHA512:
6
- metadata.gz: f197e97a0e3d34ef15ddf2b3aa496f0409982e42b15c6c69224ba1484f05c903437d62ef9df0e74eed53c9c9993b12e2c6b5a45143bece82f7064881ad47ee6b
7
- data.tar.gz: 9476964e13a4801a1f42908f515ce9978cb13ba3eacecb3b219779dab733cdb20109d84d8422ff5d139d7e20baad3e5362c2d727a0e78e0b653edd0f37a180fb
6
+ metadata.gz: 7f1049065ed3df321f857872606bf98ea10b8dd971fac43afccc4a14d8fbddc3d55671677979c94d453794b85fa5d93fcaf0865a2279adfda2a83045c0f1fb34
7
+ data.tar.gz: d9fb9b6efaef7bcf2378641f698073f551ce18a931ede8941c33808f58fa4806ac3d28cb073c4d84310d5a2de6137dc855d1d814e220999cfc1b5e0744dc09f5
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kitchen
4
4
  module Puppet
5
- VERSION = '1.46.2'.freeze
5
+ VERSION = '1.46.3'.freeze
6
6
  end
7
7
  end
@@ -227,6 +227,7 @@ module Kitchen
227
227
  INSTALL
228
228
  when /^windows.*/
229
229
  info("Installing puppet on #{puppet_platform}")
230
+ info('Powershell is not recognised by core test-kitchen assuming it is present') unless powershell_shell?
230
231
  <<-INSTALL
231
232
  if(Get-Command puppet -ErrorAction 0) { return; }
232
233
  $architecture = if( [Environment]::Is64BitOperatingSystem ) { '-x64' } else { '' }
@@ -665,7 +666,7 @@ module Kitchen
665
666
  ].join(' ')
666
667
  end
667
668
 
668
- command = powershell_shell? ? commands.join('; ') : commands.join(' && ')
669
+ command = powershell? ? commands.join('; ') : commands.join(' && ')
669
670
  debug(command)
670
671
  command
671
672
  end
@@ -822,7 +823,7 @@ module Kitchen
822
823
  end
823
824
 
824
825
  def puppet_cmd
825
- return '& "C:\Program Files\Puppet Labs\Puppet\bin\puppet"' if powershell_shell?
826
+ return '& "C:\Program Files\Puppet Labs\Puppet\bin\puppet"' if powershell?
826
827
 
827
828
  puppet_bin = config[:require_puppet_collections] ? "#{config[:puppet_coll_remote_path]}/bin/puppet" : 'puppet'
828
829
 
@@ -834,12 +835,12 @@ module Kitchen
834
835
  end
835
836
 
836
837
  def puppet_dir
837
- return 'C:/ProgramData/PuppetLabs/puppet/etc' if powershell_shell?
838
+ return 'C:/ProgramData/PuppetLabs/puppet/etc' if powershell?
838
839
  config[:require_puppet_collections] ? '/etc/puppetlabs/puppet' : '/etc/puppet'
839
840
  end
840
841
 
841
842
  def hiera_config_dir
842
- return 'C:/ProgramData/PuppetLabs/puppet/etc' if powershell_shell?
843
+ return 'C:/ProgramData/PuppetLabs/puppet/etc' if powershell?
843
844
  config[:require_puppet_collections] ? '/etc/puppetlabs/code' : '/etc/puppet'
844
845
  end
845
846
 
@@ -878,7 +879,7 @@ module Kitchen
878
879
  def puppet_manifestdir
879
880
  return nil if config[:require_puppet_collections]
880
881
  return nil if config[:puppet_environment]
881
- return nil if powershell_shell?
882
+ return nil if powershell?
882
883
  bash_vars = "export MANIFESTDIR='#{File.join(config[:root_path], 'manifests')}';"
883
884
  debug(bash_vars)
884
885
  bash_vars
@@ -955,7 +956,7 @@ module Kitchen
955
956
  def custom_facts
956
957
  return nil if config[:custom_facts].none?
957
958
  return nil if config[:install_custom_facts]
958
- if powershell_shell?
959
+ if powershell?
959
960
  environment_vars = config[:custom_facts].map { |k, v| "$env:FACTER_#{k}='#{v}'" }.join('; ')
960
961
  environment_vars = "#{environment_vars};"
961
962
  else
@@ -980,8 +981,8 @@ module Kitchen
980
981
 
981
982
  def puppet_whitelist_exit_code
982
983
  if config[:puppet_whitelist_exit_code].nil?
983
- powershell_shell? ? '; exit $LASTEXITCODE' : nil
984
- elsif powershell_shell?
984
+ powershell? ? '; exit $LASTEXITCODE' : nil
985
+ elsif powershell?
985
986
  "; if(@(#{[config[:puppet_whitelist_exit_code]].join(', ')}) -contains $LASTEXITCODE) {exit 0} else {exit $LASTEXITCODE}"
986
987
  else
987
988
  '; RC=$?; [ ' + [config[:puppet_whitelist_exit_code]].flatten.map { |x| "\$RC -eq #{x}" }.join(' -o ') + ' ] && exit 0; exit $RC'
@@ -1057,6 +1058,12 @@ module Kitchen
1057
1058
  http_proxy ? "-Proxy #{http_proxy}" : nil
1058
1059
  end
1059
1060
 
1061
+ def powershell?
1062
+ return true if powershell_shell?
1063
+ return true if puppet_platform =~ /^windows.*/
1064
+ false
1065
+ end
1066
+
1060
1067
  def export_http_proxy_parm
1061
1068
  http_proxy ? "export http_proxy=#{http_proxy}" : nil
1062
1069
  end
@@ -1257,23 +1264,23 @@ module Kitchen
1257
1264
  end
1258
1265
 
1259
1266
  def cp_command
1260
- return 'cp -force' if powershell_shell?
1267
+ return 'cp -force' if powershell?
1261
1268
  'cp'
1262
1269
  end
1263
1270
 
1264
1271
  def rm_command
1265
- return 'rm -force -recurse' if powershell_shell?
1272
+ return 'rm -force -recurse' if powershell?
1266
1273
  'rm -rf'
1267
1274
  end
1268
1275
 
1269
1276
  def mkdir_command
1270
- return 'mkdir -force -path' if powershell_shell?
1277
+ return 'mkdir -force -path' if powershell?
1271
1278
  'mkdir -p'
1272
1279
  end
1273
1280
 
1274
1281
  def rm_command_paths(paths)
1275
1282
  return :nil if paths.length.zero?
1276
- return "#{rm_command} \"#{paths.join('", "')}\"" if powershell_shell?
1283
+ return "#{rm_command} \"#{paths.join('", "')}\"" if powershell?
1277
1284
  "#{rm_command} #{paths.join(' ')}"
1278
1285
  end
1279
1286
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.46.2
4
+ version: 1.46.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neill Turner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen