Commit Graph

90475 Commits

Author SHA1 Message Date
Gareth J. Greenaway
b23e5a7db2
Updating utils/schedule.py to be able to track when jobs are skipped because of the max_running parameter. This change moves that check out of handle_func and moves it to it's own function. Also updated skip tests to include a test that _skip_reason is included in the results when a job is skipped. 2018-02-07 11:39:09 -08:00
Gareth J. Greenaway
9bd94e0d17
Track the next scheduled fire time and when jobs are skipped. 2018-02-07 11:39:09 -08:00
Nicole Thomas
a309933104
Merge pull request #45885 from terminalmage/issue45845
Catch and report YAML errors in jinja load_yaml
2018-02-07 14:08:48 -05:00
Erik Johnson
fb05654b71
Add unit tests for new Oxygen gitfs features
Also expand unit tests to test both GitPython and pygit2
2018-02-07 12:00:44 -06:00
Erik Johnson
a0f7eec7e5
Work around upstream pygit2 bug affecting unicode refs
This adds a workaround for a bug fixed upstream on 2 Feb 2018, which
caused a branch or tag containing a unicode character to raise a
UnicodeDecodeError. Additionally, it changes how we handle version
analysis in salt.utils.gitfs. We should be using the LooseVersion from
salt.utils.versions instead of distutils.version.
2018-02-07 12:00:44 -06:00
Nicole Thomas
ec590aff87
Merge pull request #45834 from terminalmage/cmdmod-unicode-compat
2 unicode-compatibility fixes for cmdmod.py
2018-02-07 09:51:14 -05:00
Nicole Thomas
2c14201d4f
Merge pull request #45888 from gtmanfred/cloud
Fix cloud tests
2018-02-07 09:15:20 -05:00
Erik Johnson
b45f5720db
Move exception catch
This was caught by pylint. Adding the TemplateRuntimeError should have
been done below UndefinedError because UndefinedError is a child class
of the TemplateRuntimeError.
2018-02-07 02:09:57 -06:00
Erik Johnson
fa72e16575
Catch YAML errors when executing a load_yaml from jinja
Use the context information from these exceptions to provide a
meaningful error message.
2018-02-07 02:09:57 -06:00
Erik Johnson
3688ae0440
Properly raise ConstructorError in construct_mapping
We were passing the wrong arguments to this exception's constructor.
This commit changes the exceptions so that they end up with the proper
attributes, allowing them to be successfully interpreted when caught.
2018-02-07 02:09:56 -06:00
Erik Johnson
b4e24a69e6
Move get_context to salt.utils.stringutils
This avoids circular dependencies when salt.utils.jinja (which is
imported by salt.utils.templates) needs to use get_context()
2018-02-07 02:09:56 -06:00
Erik Johnson
c5c03f4c3e
Add link to test.versions_report 2018-02-07 02:01:55 -06:00
Erik Johnson
22c676ce57
Add option to cmdmod funcs to specify the output encoding 2018-02-07 02:01:55 -06:00
Erik Johnson
6cef37f310
2 unicode-compatibility fixes for cmdmod.py
First, `shlex.split()` will raise an exception when passed a unicode
type with unicode characters in the string. This modifies our
`shlex.split()` helper to first convert the passed string to a `str`
type, and then return a decoded copy of the result of the split.

Second, this uses our `to_unicode` helper to more gracefully decode the
stdout and stderr from the command. Unit tests have been added to
confirm that the output is properly decoded, including instances where
decoding fails because the return from the command contains binary data.
2018-02-07 02:01:55 -06:00
Daniel Wallace
48bb46f16a
Merge branch 'oxygen.rc1' into cloud 2018-02-06 15:47:08 -07:00
Daniel Wallace
57ab20308e
fix msazure cloud test 2018-02-06 14:50:20 -07:00
Daniel Wallace
f88ff75c19
fix gce tests 2018-02-06 13:27:11 -07:00
Daniel Wallace
c8a9df0179
ec2 can have m2crypto or pycrypto 2018-02-06 13:02:07 -07:00
Nicole Thomas
fcf8a36a4a
Merge pull request #45800 from DSRCorporation/bugs/raet_deprecation
RAET transport Py3 support and shutdown fixes
2018-02-06 10:31:09 -05:00
Nicole Thomas
3e9ebb23c3
Merge pull request #45830 from garethgreenaway/multiprocessing_queue_full
[oxygen] Catch exception when logging queue is full
2018-02-05 12:38:04 -05:00
Daniel Wallace
6ae6c635d2
fix building with rackspace on openstack driver 2018-02-05 07:40:39 -07:00
Nicole Thomas
eec5d20d96
Merge pull request #45832 from terminalmage/versions-report
Change "locale" value in versions-report to use __salt_system_encoding__
2018-02-02 15:18:31 -05:00
Nicole Thomas
76f26e4397
Merge pull request #45838 from terminalmage/docs
Fix invalid Sphinx lexers in docs
2018-02-02 15:17:59 -05:00
Nicole Thomas
fbee57cf20
Merge pull request #45841 from rallytime/bp-45764
Back-port #45764 to oxygen.rc1
2018-02-02 15:17:17 -05:00
Christian McHugh
c20887ccc6
English better 2018-02-02 11:48:26 -05:00
Christian McHugh
149867e301
support amazon linux 2 for service module 2018-02-02 11:48:26 -05:00
Erik Johnson
9aa729d6f0
Change "locale" value in versions-report to use __salt_system_encoding__
locale.getpreferredencoding() may not be equal to it, and we don't use
locale.getpreferredencoding() anyway when we perform unicode conversions
in salt, we use __salt_system_encoding__.
2018-02-02 09:24:33 -06:00
Erik Johnson
2feaaa3efc
Fix invalid Sphinx lexers in docs
This clears up some warnings when we build the docs, and improves the
syntax highlighting in the docs.
2018-02-02 09:21:07 -06:00
Nicole Thomas
550a6138c9
Merge pull request #45824 from gtmanfred/setup
decode file list for setup.py on python2
2018-02-02 09:42:54 -05:00
Nicole Thomas
becfb56ed0
Merge pull request #45786 from isbm/isbm-localectl-use
Multiple bugfixes for localemod
2018-02-02 09:09:22 -05:00
Gareth J. Greenaway
df13f0b3e0
Merge branch 'oxygen.rc1' into multiprocessing_queue_full 2018-02-01 17:08:20 -08:00
Nicole Thomas
1775508993
Merge pull request #45827 from terminalmage/disks-grains-traceback
Fix traceback in disks grains when /sys/block not available
2018-02-01 17:05:32 -05:00
Gareth J. Greenaway
8a1cde9c39
Wrapping the put_nowait in a try...except and catching the exception when the multiprocessing queue is full. This situation is happening when running the full testing suite on MacOS where the queue limit is 32767 vs on Linux where the queue limit is unlimited. 2018-02-01 14:02:14 -08:00
Nicole Thomas
543ef6d8a4
Merge pull request #45703 from terminalmage/path
Improve/remove PATH environment modifications
2018-02-01 16:07:16 -05:00
Nicole Thomas
7d5cf806f9
Merge pull request #45772 from terminalmage/decode-all-the-things
Decode payloads on Python 2 to preserve unicode in jobs and fileclient reqs
2018-02-01 16:06:50 -05:00
Daniel Wallace
8ebf937b21
decode file list for setup.py on python2 2018-02-01 11:51:59 -07:00
Erik Johnson
dfa6911305
Fix traceback in disks grains when /sys/block not available
This prevents a traceback when salt is run in a container where
/sys/block is not present.
2018-02-01 12:39:38 -06:00
Erik Johnson
01194d6cdd
Update syslog_ng tests to reflect change in PATH behavior 2018-02-01 10:54:09 -06:00
Erik Johnson
1b78e49e1c
win_path: Do not normalize path to lowercase
This removes the lowercase normalization and handles case-insensitive
path matches. It also combines local path and system path inspection
into a single helper function in both add() and remove(), for simplicity.

Additionally, the add/remove unit tests have been rewritten to test
a wider array of use cases.
2018-02-01 10:54:09 -06:00
Erik Johnson
1b5c45a1fd
Add support for negative indexes 2018-02-01 10:54:09 -06:00
Erik Johnson
52ebc31f3d
Add comment regarding PATH handling 2018-02-01 10:54:09 -06:00
Erik Johnson
480009a829
Pass unicode path to reg.set_value 2018-02-01 10:54:09 -06:00
Erik Johnson
829400f939
Add comment to explain PATH handling
Also use salt.utils.path.join()
2018-02-01 10:54:09 -06:00
Erik Johnson
19d75b8eb9
Improve/remove PATH environment modifications
- `salt/modules/rbenv.py`: Forces use of str types in the custom env dict
  passed to `cmd.run_all`.
- `salt/modules/syslog_ng.py`: Ditches janky PATH munging in favor of
  the stable and long-existing support built into cmdmod.py
- `salt/modules/win_path.py`: Forces use of str types in path
  modification functions.
- `salt/states/win_path.py`: Completely rewritten. Duplicated code from
  the execution module removed in favor of calls to the execution
  module. Tests junked and 14 new tests written.
- `salt/utils/path.py`: The `which()` function was mistakenly modified
  in 20033ee to inject the directories in the POSIX default path into
  the PATH environment variable (even for Windows!). We never used the
  PATH to find the executables, we simply cycled through the dirs one by
  one and looked for an executable file matching the named path. The
  code that modifies the path is now removed. In addition, `which()` now
  uses `salt.utils.path.join()`, which gracefully handles mismatched
  str and unicode directory components to prevent decode errors.
  `join()` has also been simplified to use `salt.utils.data.decode()` to
  normalize directory components to unicode.
2018-02-01 10:54:09 -06:00
Erik Johnson
8cacaab5c6
salt.utils.path.join: Only decode when needed
This prevents a traceback when one of the paths is already unicode
2018-02-01 10:30:12 -06:00
Erik Johnson
1787d38622
Remove unused import 2018-02-01 10:30:12 -06:00
Erik Johnson
99de368afa
PY2: Fix system.set_computer_desc and set_computer_desc when desc is unicode
Both string_escape and unicode_escape don't like unicode content. This
scraps the escape encoding and simply does a series of string
replacements to disabmibguate quotes, newlines, and tab characters.
2018-02-01 10:30:12 -06:00
Erik Johnson
e0f4f70569
Update test to reflect type change due to unicode_literals 2018-02-01 10:30:12 -06:00
Bo Maryniuk
9e86a7d5f6 Lintfix: E8303 -- too many empty lines 2018-02-01 12:58:15 +01:00
Dmitry Kuzmenko
0b7fb33b03
Fixed lint errors 2018-01-31 19:15:46 +03:00