Merge pull request #46990 from rallytime/merge-2018.3

[2018.3] Merge forward from 2017.7 to 2018.3
This commit is contained in:
Nicole Thomas 2018-04-10 13:07:32 -04:00 committed by GitHub
commit ffaee26540
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 47 additions and 10 deletions

View file

@ -136,6 +136,35 @@ platforms:
provisioner:
salt_bootstrap_options: -X -p rsync git v<%= version %> >/dev/null
<% if vagrant != false %>
- name: windows-2012r2
driver:
box: mwrock/Windows2012R2
name: vagrant
gui: true
transport:
name: winrm
username: Administrator
password: Pass@word1
provisioner:
init_environment: |
Clear-Host
$AddedLocation ="c:\salt;c:\salt\bin\Scripts"
$Reg = "Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
$OldPath = (Get-ItemProperty -Path $Reg -Name PATH).Path
$NewPath= $OldPath + ";" + $AddedLocation
Set-ItemProperty -Path $Reg -Value $NewPath -Name PATH
reg add "hklm\system\currentcontrolset\control\session manager\memory management" /v pagingfiles /t reg_multi_sz /d "d:\pagefile.sys 4096 8192" /f
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="5000"}'
salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
salt_bootstrap_options: ''
verifier:
windows: true
types:
- unit
coverage_xml: false
save:
$env:TEMP/salt-runtests.log: artifacts/logs/salt-runtests.log
/salt/var/log/salt/minion: artifacts/logs/minion
- name: windows-2016
driver:
box: mwrock/Windows2016
@ -158,12 +187,18 @@ platforms:
$OldPath = (Get-ItemProperty -Path $Reg -Name PATH).Path
$NewPath= $OldPath + ";" + $AddedLocation
Set-ItemProperty -Path $Reg -Value $NewPath -Name PATH
reg add "hklm\system\currentcontrolset\control\session manager\memory management" /v pagingfiles /t reg_multi_sz /d "d:\pagefile.sys 4096 8192" /f
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="5000"}'
salt_bootstrap_url: https://raw.githubusercontent.com/saltstack/salt-bootstrap/develop/bootstrap-salt.ps1
salt_bootstrap_options: ''
verifier:
windows: true
types:
- unit
coverage_xml: false
xml: /tmp/xml-unittests-output/
save:
/tmp/xml-unittests-output/: artifacts/
$env:TEMP/salt-runtests.log: artifacts/logs/salt-runtests.log
/salt/var/log/salt/minion: artifacts/logs/minion
<% end %>

View file

@ -2,7 +2,7 @@
source 'https://rubygems.org'
gem 'test-kitchen', '~>1.20'
gem 'test-kitchen', :git => 'https://github.com/gtmanfred/test-kitchen.git'
gem 'kitchen-salt', :git => 'https://github.com/saltstack/kitchen-salt.git'
gem 'kitchen-sync'
gem 'git'
@ -20,7 +20,7 @@ group :windows do
gem 'vagrant-wrapper'
gem 'kitchen-vagrant'
gem 'winrm', '~>2.0'
gem 'winrm-fs', '>=1.1.1'
gem 'winrm-fs', :git => 'https://github.com/gtmanfred/winrm-fs.git'
end
group :ec2 do

View file

@ -12,7 +12,6 @@ idna==2.5
ioloop==0.1a0
ipaddress==1.0.18
Jinja2==2.9.6
libnacl==1.6.1
lxml==3.7.3
Mako==1.0.6
MarkupSafe==1.0

View file

@ -119,10 +119,15 @@ def query(key, value=None, service=None, profile=None): # pylint: disable=W0613
**key_vars
)
extras = {}
for item in profile[key]:
if item not in ('backend', 'url'):
extras[item] = profile[key][item]
result = http.query(
url,
decode=True,
**key_vars
**extras
)
return result['dict']

View file

@ -5141,15 +5141,13 @@ def patch(name,
dry_run_first=True,
**kwargs):
'''
Apply a patch to a file or directory.
Ensure that a patch has been applied to the specified file
.. note::
A suitable ``patch`` executable must be available on the minion when
using this state function.
A suitable ``patch`` executable must be available on the minion
name
The file or directory to which the patch will be applied.
The file to which the patch should be applied
source
The source patch to download to the minion, this source file must be

View file

@ -129,7 +129,7 @@ class ScriptPathMixin(object):
sfh.write(
'#!{0}\n\n'.format(sys.executable) +
'import sys\n' +
'CODE_DIR="{0}"\n'.format(CODE_DIR) +
'CODE_DIR = r"{0}"\n'.format(CODE_DIR) +
'if CODE_DIR not in sys.path:\n' +
' sys.path.insert(0, CODE_DIR)\n\n' +
'\n'.join(script_template).format(script_name.replace('salt-', ''))