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

Skip to content

Commit 0845bdb

Browse files
Merge branch 'develop' into win_service_dependencies
2 parents 4fe96f4 + 287ee16 commit 0845bdb

35 files changed

+1166
-281
lines changed

.kitchen.yml

Lines changed: 1 addition & 1 deletion
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:

doc/ref/modules/all/index.rst

Lines changed: 1 addition & 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

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:

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::
62 55F 80
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

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)

0 commit comments

Comments
 (0)
0