8000 Merge branch 'develop' into saltcmd · perlchild/salt@f4d7925 · GitHub
[go: up one dir, main page]

Skip to content

Commit f4d7925

Browse files
8000
Merge branch 'develop' into saltcmd
2 parents d6564fc + 2085cb1 commit f4d7925

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1225
-323
lines changed

.kitchen.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ provisioner:
3939
max_retries: 2
4040
remote_states:
4141
name: git://github.com/saltstack/salt-jenkins.git
42-
branch: master
42+
branch: develop
4343
repo: git
4444
testingdir: /testing
4545
salt_copy_filter:
@@ -54,7 +54,7 @@ provisioner:
5454
base:
5555
"os:Windows":
5656
- match: grain
57-
- prep_windows
57+
- windows
5858
"*":
5959
- <%= ENV['KITCHEN_STATE'] || 'git.salt' %>
6060
pillars:

doc/ref/modules/all/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ execution modules
213213
keystoneng
214214
keystore
215215
kmod
216-
kubernetes
216+
kubernetesmod
217217
launchctl_service
218218
layman
219219
ldap3
@@ -511,6 +511,7 @@ execution modules
511511
xapi_virt
512512
xbpspkg
513513
xfs
514+
xml
514515
xmpp
515516
yumpkg
516517
zabbix

doc/ref/modules/all/salt.modules.kubernetes.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
==========================
2+
salt.modules.kubernetesmod
3+
==========================
4+
5+
.. automodule:: salt.modules.kubernetesmod
6+
:members:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
================
2+
salt.modules.xml
3+
================
4+
5+
.. automodule:: salt.modules.xml
6+
:members:

doc/ref/states/all/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ state modules
316316
win_wua
317317
winrepo
318318
x509
319+
xml
319320
xmpp
320321
zabbix_action
321322
zabbix_host
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
===============
2+
salt.states.xml
3+
===============
4+
5+
.. automodule:: salt.states.xml
6+
:members:

doc/topics/development/conventions/documentation.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,17 @@ Building the documentation
340340
4. A useful method of viewing the HTML documentation locally is to start
341341
Python's built-in HTTP server:
342342

343+
Python 3:
344+
343345
.. code-block:: bash
346+
347+
cd /path/to/salt/doc/_build/html
348+
python3 -m http.server
344349

350+
Python 2:
351+
352+
.. code-block:: bash
353+
345354
cd /path/to/salt/doc/_build/html
346355
python -m SimpleHTTPServer
347356

doc/topics/installation/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Dependencies
8787

8888
Salt should run on any Unix-like platform so long as the dependencies are met.
8989

90-
* `Python 2.7`_ >= 2.7 <3.0
90+
* `Python`_ - Python2 >= 2.7, Python3 >= 3.4
9191
* `msgpack-python`_ - High-performance message interchange format
9292
* `YAML`_ - Python YAML bindings
9393
* `Jinja2`_ - parsing Salt States (configurable in the master settings)
@@ -96,7 +96,7 @@ Salt should run on any Unix-like platform so long as the dependencies are met.
9696
cloud service providers using a unified API
9797
* `Requests`_ - HTTP library
9898
* `Tornado`_ - Web framework and asynchronous networking library
99-
* `futures`_ - Backport of the concurrent.futures package from Python 3.2
99+
* `futures`_ - Python2 only dependency. Backport of the concurrent.futures package from Python 3.2
100100

101101
* ZeroMQ:
102102

@@ -136,7 +136,7 @@ Optional Dependencies
136136
settings)
137137
* gcc - dynamic `Cython`_ module compiling
138138

139-
.. _`Python 2.7`: http://python.org/download/
139+
.. _`Python`: http://python.org/download/
140140
.. _`ZeroMQ`: http://zeromq.org/
141141
.. _`pyzmq`: https://github.com/zeromq/pyzmq
142142
.. _`msgpack-python`: https://pypi.python.org/pypi/msgpack-python/

doc/topics/releases/2017.7.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ Execution modules
710710
- :mod:`salt.modules.grafana4 <salt.modules.grafana4>`
711711
- :mod:`salt.modules.heat <salt.modules.heat>`
712712
- :mod:`salt.modules.icinga2 <salt.modules.icinga2>`
713-
- :mod:`salt.modules.kubernetes <salt.modules.kubernetes>`
713+
- :mod:`salt.modules.kubernetesmod <salt.modules.kubernetesmod>`
714714
- :mod:`salt.modules.logmod <salt.modules.logmod>`
715715
- :mod:`salt.modules.mattermost <salt.modules.mattermost>`
716716
- :mod:`salt.modules.namecheap_dns <salt.modules.namecheap_dns>`

doc/topics/releases/2019.2.0.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@ Jinja filter`_:
5858
- context:
5959
data: {{ data|tojson }}
6060
61+
Another example where the new filter needs to be used is the following state example:
62+
63+
.. code-block:: jinja
64+
65+
grafana_packages:
66+
pkg.installed:
67+
- names: {{ server.pkgs }}
68+
69+
This will fail when pkgs is a list or dictionary. You will need to update the state:
70+
71+
.. code-block:: jinja
72+
73+
grafana_packages:
74+
pkg.installed:
75+
- names: {{ server.pkgs|tojson }}
76+
77+
This test case has also been tested with the ``yaml`` and ``json`` filters successfully.
78+
6179
.. note::
6280
This filter was added in Jinja 2.9. However, fear not! The 2018.3.3 release
6381
added a ``tojson`` filter which will be used if this filter is not already

doc/topics/releases/neon.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Saltcheck Updates
1818

1919
Available since 2018.3, the :py:func:`saltcheck module <salt.modules.saltcheck>`
2020
has been enhanced to:
21+
2122
* Support saltenv environments
2223
* Associate tests with states by naming convention
2324
* Adds empty and notempty assertions

salt/_compat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# Import python libs
88
from __future__ import absolute_import, unicode_literals, print_function
99
import sys
10-
import types
1110
import logging
11+
import binascii
1212

1313
# Import 3rd-party libs
1414
from salt.exceptions import SaltException
@@ -173,7 +173,7 @@ def __init__(self, address):
173173
self._ip = address
174174
elif self._is_packed_binary(address):
175175
self._check_packed_address(address, 16)
176-
self._ip = ipaddress._int_from_bytes(address, 'big')
176+
self._ip = int(binascii.hexlify(address), 16)
177177
else:
178178
address = str(address)
179179
if '/' in address:
@@ -190,7 +190,7 @@ def _is_packed_binary(self, data):
190190
packed = False
191191
if isinstance(data, bytes) and len(data) == 16 and b':' not in data:
192192
try:
193-
packed = bool(int(str(bytearray(data)).encode('hex'), 16))
193+
packed = bool(int(binascii.hexlify(data), 16))
194194
except (ValueError, TypeError):
195195
pass
196196

salt/beacons/inotify.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,21 +238,21 @@ def beacon(config):
238238
break
239239
path = os.path.dirname(path)
240240

241-
for path in _config.get('files', {}):
242-
excludes = _config['files'][path].get('exclude', '')
241+
excludes = _config['files'][path].get('exclude', '')
243242

244243
if excludes and isinstance(excludes, list):
245244
for exclude in excludes:
246245
if isinstance(exclude, dict):
247-
if exclude.values()[0].get('regex', False):
246+
_exclude = next(iter(exclude))
247+
if exclude[_exclude].get('regex', False):
248248
try:
249-
if re.search(list(exclude)[0], event.pathname):
249+
if re.search(_exclude, event.pathname):
250250
_append = False
251251
except Exception:
252252
log.warning('Failed to compile regex: %s',
253-
list(exclude)[0])
253+
_exclude)
254254
else:
255-
exclude = list(exclude)[0]
255+
exclude = _exclude
256256
elif '*' in exclude:
257257
if fnmatch.fnmatch(event.pathname, exclude):
258258
_append = False
@@ -312,7 +312,7 @@ def beacon(config):
312312
excl = []
313313
for exclude in excludes:
314314
if isinstance(exclude, dict):
315-
excl.append(exclude.keys()[0])
315+
excl.append(list(exclude)[0])
316316
else:
317317
excl.append(exclude)
318318
excl = pyinotify.ExcludeFilter(excl)

salt/engines/logentries.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
3030
engines:
3131
- logentries:
32-
endpoint: data.logentries.com
33-
port: 10000
34-
token: 057af3e2-1c05-47c5-882a-5cd644655dbf
32+
endpoint: data.logentries.com
33+
port: 10000
34+
token: 057af3e2-1c05-47c5-882a-5cd644655dbf
3535
3636
The 'token' can be obtained from the Logentries service.
3737

salt/engines/logstash_engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
1414
engines:
1515
- logstash:
16-
host: log.my_network.com
17-
port: 5959
18-
proto: tcp
16+
host: log.my_network.com
17+
port: 5959
18+
proto: tcp
1919
2020
:depends: logstash
2121
'''

salt/grains/disks.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,13 @@ def _windows_disks():
157157

158158
namespace = r'\\root\microsoft\windows\storage'
159159
path = 'MSFT_PhysicalDisk'
160-
where = '(MediaType=3 or MediaType=4)'
161160
get = 'DeviceID,MediaType'
162161

163162
ret = {'disks': [], 'SSDs': []}
164163

165164
cmdret = __salt__['cmd.run_all'](
166-
'{0} /namespace:{1} path {2} where {3} get {4} /format:table'.format(
167-
wmic, namespace, path, where, get))
165+
'{0} /namespace:{1} path {2} get {3} /format:table'.format(
166+
wmic, namespace, path, get))
168167

169168
if cmdret['retcode'] != 0:
170169
log.trace('Disk grain does not support this version of Windows')
@@ -181,10 +180,12 @@ def _windows_disks():
181180
elif mediatype == '4':
182181
log.trace('Device %s reports itself as an SSD', device)
183182
ret['SSDs'].append(device)
183+
ret['disks'].append(device)
184+
elif mediatype == '5':
185+
log.trace('Device %s reports itself as an SCM', device)
186+
ret['disks'].append(device)
184187
else:
185-
log.trace(
186-
'Unable to identify device %s as an SSD or HDD. It does '
187-
'not report 3 or 4', device
188-
)
188+
log.trace('Device %s reports itself as Unspecified', device)
189+
ret['disks'].append(device)
189190

190191
return ret

salt/minion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,11 +2278,11 @@ def manage_schedule(self, tag, data):
22782278
'disable_job': ('disable_job', (name, persist)),
22792279
'postpone_job': ('postpone_job', (name, data)),
22802280
'skip_job': ('skip_job', (name, data)),
2281-
'reload': ('reload', (schedule)),
2282-
'list': ('list', (where)),
2281+
'reload': ('reload', (schedule,)),
2282+
'list': ('list', (where,)),
22832283
'save_schedule': ('save_schedule', ()),
22842284
'get_next_fire_time': ('get_next_fire_time',
2285-
(name))}
2285+
(name,))}
22862286

22872287
# Call the appropriate schedule function
22882288
try:

0 commit comments

Comments
 (0)
0