Commit Graph

99445 Commits

Author SHA1 Message Date
Gareth J. Greenaway
9c04986641
Merge branch '2018.3' into merge-fluorine
Conflicts:
	doc/conf.py
	doc/topics/development/dunder_dictionaries.rst
	salt/client/ssh/ssh_py_shim.py
	salt/grains/core.py
	salt/modules/mysql.py
	salt/modules/state.py
2018-12-20 17:20:42 -08:00
Daniel Wozniak
49f2a359d4
Merge pull request #50937 from Ch3LL/pillar_doc
Fix external_pillars documentation
2018-12-20 12:15:20 -07:00
Erik Johnson
42135271ff
Merge pull request #50940 from terminalmage/issue50919
Fix confusing state module documentation
2018-12-20 12:29:25 -06:00
Daniel Wozniak
421e4f459f
Merge pull request #50929 from twangboy/fix_test_lgpo_netsh_2018.3
Fix `unit.utils.test_lgpo_netsh` on Windows for Py3 (2018.3)
2018-12-20 10:50:36 -07:00
Daniel Wozniak
4577c2111d
Merge pull request #50928 from twangboy/fix_test_lgpo_netsh
Fix `unit.utils.test_lgpo_netsh` on Windows for Py3
2018-12-20 10:50:08 -07:00
Erik Johnson
331892778d
Fix confusing state module documentation
Since `test` is an argument, using it as an example SLS target is
confusing. This replaces it to make the documentation easier to
understand.
2018-12-20 11:40:46 -06:00
Gareth J. Greenaway
68851de5a6
Merge pull request #50934 from mirceaulinic/fix-50924
#50924: Check if running a NAPALM Proxy or regular Minion
2018-12-20 08:40:38 -08:00
Ch3LL
1f01489017
Fix external_pillars documentation 2018-12-20 11:05:43 -05:00
Mircea Ulinic
08cb05d448 #50924: Check if running a NAPALM Proxy or regular Minion 2018-12-20 13:44:11 +00:00
twangboy
01f9beb5a9
Fix failing lgpo netsh tests 2018-12-19 22:35:17 -07:00
twangboy
db2a1cc016
Fix failing tests on Py3
These should have been failing across the board. I don't know what's
going on with the tests suite
2018-12-19 22:32:33 -07:00
Daniel Wozniak
483fad4117
Merge pull request #50918 from twangboy/fix_test_debian_ip
Fix `test_debian_ip` on Windows
2018-12-19 12:08:12 -07:00
Daniel Wozniak
b08b7e1fd6
Merge pull request #50917 from dwoz/test_fixes
Cherry pick test fixes from fluorine
2018-12-19 10:56:18 -07:00
Daniel Wozniak
6b780c6d36
Merge pull request #50916 from dwoz/gitfsfix
Do not pass unicode in environment
2018-12-19 10:52:44 -07:00
twangboy
bbc12446a8
Skip debian tests on Windows 2018-12-19 10:14:02 -07:00
twangboy
7ba54cd7b2
Fix test_debian_ip on Windows 2018-12-19 10:05:03 -07:00
Daniel A. Wozniak
16d10fbad7
Fix linter warnings 2018-12-19 10:03:18 -07:00
Daniel A. Wozniak
b22f827e79
Increase and standardize ShellCase timeouts 2018-12-19 10:02:57 -07:00
Daniel A. Wozniak
a5c8c18cd0
Do not pass unicode in environment 2018-12-19 10:01:30 -07:00
Daniel A. Wozniak
f06898e85d
Do not pass unicode in environment 2018-12-19 09:52:01 -07:00
Erik Johnson
59df6b4bd2
Merge pull request #50913 from bdrung/fix-doc-build
Fix documentation build
2018-12-19 10:03:54 -06:00
Benjamin Drung
ecdb452e8a doc: Indroduce MOCK_MODULES_MAPPING
Some mocks needs some attributes defined (instead of having them returning a
mock object). Introduce a MOCK_MODULES_MAPPING mapping that defines these
attributes. This gets rid of a special handling for psutil.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:37 +01:00
Benjamin Drung
cf648246ea doc: Move mock_decorator_with_params up
Refactor conf.py and move mock_decorator_with_params for the following commit.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:37 +01:00
Benjamin Drung
08ef6694ea doc: Address pylint issues in conf.py
pylint finds issues in doc/conf.py:

```
pylint3 conf.py
************* Module conf
conf.py:226:0: C0330: Wrong hanging indentation (remove 4 spaces).
        os.pardir,  # salt itself (for autodoc)
    |   ^ (bad-continuation)
conf.py:227:0: C0330: Wrong hanging indentation (remove 4 spaces).
        '_ext',  # custom Sphinx extensions
    |   ^ (bad-continuation)
conf.py:374:0: C0301: Line too long (106/100) (line-too-long)
conf.py:442:0: C0330: Wrong hanging indentation (add 2 spaces).
  ('contents', 'Salt.tex', 'Salt Documentation', 'SaltStack, Inc.', 'manual'),
  ^ | (bad-continuation)
conf.py:485:0: C0301: Line too long (107/100) (line-too-long)
conf.py:27:0: W0613: Unused argument 'args' (unused-argument)
conf.py:27:0: W0613: Unused argument 'kwargs' (unused-argument)
conf.py:58:4: R0201: Method could be a function (no-self-use)
conf.py:198:8: R1705: Unnecessary "else" after "return" (no-else-return)
conf.py:197:0: W0613: Unused argument 'iargs' (unused-argument)
conf.py:197:0: W0613: Unused argument 'ikwargs' (unused-argument)
conf.py:187:0: W0613: Unused argument 'oargs' (unused-argument)
conf.py:187:0: W0613: Unused argument 'okwargs' (unused-argument)
conf.py:533:0: R0913: Too many arguments (6/5) (too-many-arguments)
conf.py:533:25: W0613: Unused argument 'app' (unused-argument)
conf.py:533:30: W0613: Unused argument 'what' (unused-argument)
conf.py:533:47: W0613: Unused argument 'skip' (unused-argument)
conf.py:533:53: W0613: Unused argument 'options' (unused-argument)
conf.py:542:7: W0621: Redefining name 'path' from outer scope (line 230) (redefined-outer-name)
conf.py:6:0: W0611: Unused import functools (unused-import)
conf.py:310:4: W0611: Unused import sphinxcontrib.spelling (unused-import)
```

Address those or silince pylint for wanted behavior.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:35 +01:00
Benjamin Drung
67a3e371a6 doc: Mark preamble variable as raw string
Importing `doc/conf.py` fails with Python 3.7:

```
>>> from conf import Mock
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "doc/conf.py", line 454
    ''',
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 5-6: truncated \uXXXX escape
```

Therefore mark the string as raw due to the backslashes.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:03 +01:00
Benjamin Drung
b1e6080329 doc: Fix reference to salt executors
sphinx shows a warning:

doc/topics/development/modules/index.rst:133: WARNING: undefined label:
all-salt_executors (if the link has no caption the label must precede a section
header)

The executors reference is called all-salt.executors (with a dot instead of an
underscore).

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:03 +01:00
Benjamin Drung
e48b3247c2 doc: Replace \xa0 (non-breaking space) by spaces
Creating the documentation produces a warning:

```
doc/topics/targeting/index.rst:90: WARNING: Could not lex literal_block as "yaml". Highlighting skipped.
```

Therefore replace the non-breaking spaces \xa0 by normal spaces.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:55:03 +01:00
Benjamin Drung
b973e7aae1 doc: Fix iterating over the Mock object in Python 3
Building the documentation for salt.modules.snapper fails with Python 3:

```
$ make -C doc html
[...]
WARNING: [autosummary] failed to import 'salt.modules.snapper': no module named salt.modules.snapper
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 109 source files that are out of date
updating environment: [config changed] 1608 added, 17 changed, 0 removed
reading sources... [100%] topics/yaml/index
doc/ref/modules/all/index.rst:20: WARNING: failed to import snapper
doc/ref/modules/all/index.rst:20: WARNING: toctree references unknown document 'ref/modules/all/snapper'
WARNING: autodoc: failed to import module 'salt.modules.snapper'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line 152, in import_module
    __import__(modname)
  File "salt/modules/snapper.py", line 72, in <module>
    if SNAPPER_DBUS_OBJECT in bus.list_activatable_names():
TypeError: argument of type 'Mock' is not iterable
```

Fix the Mock object to be iterable (as it was intended to).

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:54:39 +01:00
Benjamin Drung
bb2994898c doc: Do not mock non-existing __mro_entries__ attribute
Building the documentation with the Python 3.7 version of sphinx fails:

```
$ make -C doc html SPHINXBUILD="python3.7 /usr/bin/sphinx-build"
[...]
WARNING: autodoc: failed to import module 'salt.states.pkg'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line 152, in import_module
    __import__(modname)
  File "salt/states/pkg.py", line 84, in <module>
    import salt.utils.pkg
  File "salt/utils/pkg/__init__.py", line 13, in <module>
    import salt.utils.data
  File "salt/utils/data.py", line 23, in <module>
    import salt.utils.yaml
  File "salt/utils/yaml.py", line 9, in <module>
    from salt.utils.yamldumper import *
  File "salt/utils/yamldumper.py", line 34, in <module>
    class IndentMixin(Dumper):
TypeError: __mro_entries__ must return a tuple
```

Instead of returning a Mock object for the `__mro_entries__` attribute, raise
an AttributeError instead.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:28:04 +01:00
Benjamin Drung
e6cf3c4a94 Do not mock json when building the documentation
Building the documentation on Debian unstable with Python 3.7 fails:

```
debian-unstable$ HTML_THEME=saltstack make -C doc html
make: Entering directory 'doc'
No need to update translations. Skipping...
sphinx-build -b html -d _build/doctrees    . _build/html
Running Sphinx v1.7.9
loading translations [en]... done

Exception occurred:
  File "/usr/lib/python3/dist-packages/sphinx/util/jsonimpl.py", line 22, in <module>
    class SphinxJSONEncoder(json.JSONEncoder):
TypeError: __mro_entries__ must return a tuple
The full traceback has been saved in /tmp/sphinx-err-wzl9_n0k.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [Makefile:72: html] Error 2
make: Leaving directory 'doc'
debian-unstable$ cat /tmp/sphinx-err-wzl9_n0k.log

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/cmdline.py", line 303, in main
    args.warningiserror, args.tags, args.verbosity, args.jobs)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 187, in __init__
    self.setup_extension(extension)
  File "/usr/lib/python3/dist-packages/sphinx/application.py", line 411, in setup_extension
    self.registry.load_extension(self, extname)
  File "/usr/lib/python3/dist-packages/sphinx/registry.py", line 315, in load_extension
    mod = __import__(extname, None, None, ['setup'])
  File "/usr/lib/python3/dist-packages/sphinx/builders/applehelp.py", line 20, in <module>
    from sphinx.builders.html import StandaloneHTMLBuilder
  File "/usr/lib/python3/dist-packages/sphinx/builders/html.py", line 43, in <module>
    from sphinx.util import jsonimpl, logging, status_iterator
  File "/usr/lib/python3/dist-packages/sphinx/util/jsonimpl.py", line 22, in <module>
    class SphinxJSONEncoder(json.JSONEncoder):
TypeError: __mro_entries__ must return a tuple
```

The json module is a standard module. I is always present. So do not mock it.

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2018-12-19 13:27:54 +01:00
Cédric Bosdonnat
4acaf459b4 Fix sphynx error about tornado.version_info
This is fix errors like the following when building docs:

WARNING: autodoc: failed to import module 'salt.states.saltmod'; the following exception was raised:
Traceback (most recent call last):
  File "/public/src/salt/env/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 140, in import_module
    __import__(modname)
  File "/public/src/salt/salt/states/saltmod.py", line 36, in <module>
    import salt.output
  File "/public/src/salt/salt/output/__init__.py", line 19, in <module>
    import salt.loader
  File "/public/src/salt/salt/loader.py", line 23, in <module>
    import salt.config
  File "/public/src/salt/salt/config/__init__.py", line 27, in <module>
    import salt.utils.network
  File "/public/src/salt/salt/utils/network.py", line 35, in <module>
    import salt.utils.zeromq
  File "/public/src/salt/salt/utils/zeromq.py", line 39, in <module>
    if tornado.version_info < (5,):
TypeError: '<' not supported between instances of 'Mock' and 'tuple'

(cherry picked from commit 8199700fdb)
2018-12-19 12:13:09 +01:00
Thomas S Hatch
f4e6b88ae4
Merge pull request #50906 from garethgreenaway/50892_archive_extracted_source_hash_case_sensitive
[2018.3] Ensure source_hash returned from get_source_sum is lowercase.
2018-12-18 21:22:22 -07:00
Gareth J. Greenaway
bcf8f06aa4
fixing lint 2018-12-18 16:48:14 -08:00
Gareth J. Greenaway
543ec7bc79
Ensure source_hash returned from get_source_sum is lowercase. 2018-12-18 16:51:26 -07:00
Daniel Wozniak
abf55a2b68
Merge pull request #50902 from dwoz/shell_case_timeouts
Increase and standardize ShellCase timeouts
2018-12-18 16:29:11 -07:00
Daniel A. Wozniak
daffcb3b6a
Fix linter warnings 2018-12-18 13:05:45 -07:00
Daniel A. Wozniak
a5dffb9efe
Increase and standardize ShellCase timeouts 2018-12-18 12:51:06 -07:00
Gareth J. Greenaway
f2b9e7f1bc
Merge pull request #50897 from cbosdo/misc-virt-fixes
Misc virt fixes
2018-12-18 09:40:14 -08:00
Cédric Bosdonnat
f81d66d53a
pylint: fix libvirt_events.py
Fix unused variable in _domain_event_graphics_cb.
2018-12-18 17:16:20 +01:00
Cédric Bosdonnat
1672546d4c
virt update/init: update current memory with memory
Setting the <memory> element in the libvirt definition just changes the
maximum amount of memory. Also set the <currentMemory> amount to the
same value.
2018-12-18 17:16:14 +01:00
Cédric Bosdonnat
0d32cb9228 libvirt events: fix domain defined/updated event details
Libvirt events algorigthm converting the libvirt enums into string has a
flaw that unit tests couldn't see. Libvirt python binding defines the
following constants:

VIR_DOMAIN_EVENT_CRASHED_PANICKED = 0
VIR_DOMAIN_EVENT_DEFINED = 0
VIR_DOMAIN_EVENT_CRASHED = 8

However VIR_DOMAIN_EVENT_CRASHED_PANICKED is the only value in this enum
and thus wasn't not considered a sub-enum element. So the value 0 in
enum 'VIR_DOMAIN_EVENT_' was wrongly mapped to "crashed panicked"
instead of "defined".

In order to safely rule this case out, check if we have an item that
just ends with the subprefix without the '_'.
2018-12-18 16:00:15 +01:00
Gareth J. Greenaway
80197bc49e
Merge pull request #50855 from dwoz/issue50791
Let minions try to connect to master indefinitly
2018-12-17 10:12:59 -08:00
Gareth J. Greenaway
165d7336cd
Merge branch 'fluorine' into issue50791 2018-12-17 10:10:38 -08:00
Daniel Wozniak
ea99008c88
Merge pull request #50875 from twangboy/fix_test_user
Fix `unit.modules.test_win_goupadd` on Windows
2018-12-14 16:47:11 -07:00
Gareth J. Greenaway
b95b44fa90
Merge pull request #50867 from Ch3LL/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-12-14 13:32:22 -08:00
Gareth J. Greenaway
07f51bf87e
Merge pull request #50868 from Ch3LL/merge-fluorine
[fluorine] Merge forward from 2018.3 to fluorine
2018-12-14 13:31:25 -08:00
twangboy
8997550040
Fix unit tests 2018-12-14 14:12:49 -07:00
Ch3LL
10cb130eb6
Add tempfile import in file tests 2018-12-14 13:18:11 -05:00
Ch3LL
512293fd93
Remove dunder_dictionaries.rst. Was added to modules/developing.rst 2018-12-14 12:55:39 -05:00
Ch3LL
449fa2e7ee
Merge branch '2018.3' into 'fluorine'
Conflicts:
  - salt/templates/debian_ip/debian_eth.jinja
2018-12-14 11:39:49 -05:00