Commit Graph

12792 Commits

Author SHA1 Message Date
Ch3LL
4f1c42c0e3
Workaround getpwnam in auth test for MacOSX 2018-03-27 15:18:29 -04:00
Daniel Wallace
fd0e649d1e
only use npm test work around on newer versions
The workaround only needs to be applied to versions of npm newer than 5.1, but
they work with versions newer than 5.0, so just do all newer versions using the
work around
2018-03-27 13:51:21 -05:00
Daniel A. Wozniak
18b1730320
Skip test that requires pywin32 on *nix platforms 2018-03-27 11:38:20 -07:00
Daniel A. Wozniak
ec4634fc06
Better explanation in doc strings 2018-03-27 10:35:51 -07:00
Erik Johnson
6502b6b4ff
Make busybox image builder work with newer busybox releases 2018-03-27 10:55:52 -05:00
rallytime
00d4eb26f3
Merge branch '2018.3.0rc1' into '2018.3'
Conflicts:
  - pkg/windows/req.txt
2018-03-27 11:41:56 -04:00
Nicole Thomas
3f21e9cc65
Merge pull request #46503 from psyer/fix-cmd-run-env-corrupt
Fixes stdout user environment corruption
2018-03-27 10:20:14 -04:00
Gareth J. Greenaway
042930bd3b
A couple more fixes to ensure everything works consistently under python2 and python3, adjusting things that should be bytes and things that should be strings. Updating tests to reflect changes. 2018-03-26 21:51:51 -07:00
Nicole Thomas
0faced1d54
Merge pull request #46565 from twangboy/win_fix_cmd_powershell_2018.3
Create reg salt util (2018.3)
2018-03-26 18:03:33 -04:00
twangboy
5ee64e9b0e
Fix lint (spelling error) 2018-03-26 13:02:53 -06:00
Daniel A. Wozniak
45dce1a485
Add reg module to globals 2018-03-26 12:00:39 -07:00
Nicole Thomas
fadc5e4ba4
Merge pull request #46669 from terminalmage/pillar-merge-order
Add option to return to pre-2017.7.3 pillar include merge order
2018-03-26 15:00:27 -04:00
Daniel A. Wozniak
d9ae2abb34
Fix splling in docstring 2018-03-26 09:45:04 -07:00
Nicole Thomas
84579e7652
Merge pull request #46643 from mcalmer/fix-docker-return
fix docker return
2018-03-26 11:52:31 -04:00
Nicole Thomas
6c80d90bb6
Merge pull request #46693 from dwoz/test_smtp_return
File and Pillar roots are dictionaries
2018-03-26 11:15:37 -04:00
Nicole Thomas
c67afbeb36
Merge pull request #46650 from Ch3LL/nacl_test
Mirror libnacl imports in test from the nacl module
2018-03-26 10:48:39 -04:00
Nicole Thomas
47409eaa6e
Merge pull request #46646 from twangboy/win_fix_test_local_cache
Fix `unit.returners.test_local_cache` for Windows
2018-03-26 10:16:22 -04:00
Erik Johnson
71a1d2b40a
Fix batch tests on Python 3 2018-03-26 08:56:54 -05:00
Gareth J. Greenaway
19fd2b621a
Fixing integration tests that were failing. 2018-03-25 17:39:33 -07:00
Gareth J. Greenaway
d2672f0db9
Adding issue-46672.sls for new state.py test. 2018-03-24 10:07:50 -07:00
Gareth J. Greenaway
e721168dc4
removing salt.utils.stringutils.to_unicode from output/highstate.py and adding encoding=utf-8 to events payloads. 2018-03-23 19:09:20 -07:00
Daniel A Wozniak
b40efc5db8
Windows test client fixes
- Skip IPC transport test on windows
- Add TCP transport test for windows
2018-03-23 15:36:32 -07:00
Daniel A. Wozniak
5bf850c67f
File and Pillar roots are dictionaries
Fixes test_smtp_return test cases.
2018-03-23 11:42:14 -07:00
Ch3LL
7cda825e90
Add groupadd module integration tests for Windows 2018-03-23 13:30:22 -04:00
Daniel A Wozniak
628b87d5c4
Skip test when git symlinks are not configured 2018-03-22 23:30:15 -07:00
twangboy
0de54ed953
Additional tests
Adds additional tests for unicode scenarios
Fixes an issue with reg.py when deleting unicode keys
Puts the destructive tests in a try/except block so the delete occurs no
matter what
Uses a randomly generated key name for testing
2018-03-22 15:59:46 -06:00
Daniel A. Wozniak
73d06f664b Fix linter error 2018-03-22 13:47:41 -07:00
twangboy
fc9ecd75e2
Skip unit.state.test_reg unless on Windows 2018-03-22 14:29:35 -06:00
twangboy
e0d201a96f
Make sure the docs are correct for the tests 2018-03-22 14:29:34 -06:00
twangboy
f15f92318d
Add tests for salt.utils.win_reg
Fix some issues found in testing
2018-03-22 14:29:34 -06:00
Erik Johnson
b4a1d34b47
Add option to return to pre-2017.7.3 pillar include merge order
https://github.com/saltstack/salt/pull/45025 changed the pillar include
merge order. This adds a new config option which allows a user to revert
to the pre-2017.7.3 behavior.
2018-03-22 13:35:12 -05:00
Daniel A. Wozniak
009a8f56ea
Fix up environ state tests for Windows 2018-03-22 11:31:25 -07:00
Michael Calmer
3ceb63f607 fix checking test results 2018-03-22 16:31:46 +01:00
Michael Calmer
af64632bf3 add unit test for failed login 2018-03-22 08:57:16 +01:00
Daniel A. Wozniak
b4be10b8fc
Fixing cleanUp method to restore environment
The clean-up method was not reliabliy restoring sys.environment on
windows. Using Mock's patch to cleanup more reliably.
2018-03-21 20:01:30 -07:00
Mike Place
2e1f7c37f7
Merge pull request #46569 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-03-21 20:57:04 +00:00
Mike Place
33af3cfc7c
Merge pull request #46631 from rallytime/update-pillar-unit-tests
Fix pillar unit test failures: file_roots and pillar_roots environments should be lists
2018-03-21 19:22:48 +00:00
Ch3LL
9fef8bc431
Mirror libnacl imports in test from the nacl runner 2018-03-21 15:18:58 -04:00
Ch3LL
f11d58a8e9
Mirror libnacl imports in test from the nacl module 2018-03-21 15:10:46 -04:00
twangboy
c179388b0e
Fix the tear down function in integration.modules.test_grains.GrainsAppendTestCase
Fix the tear down function to just set the grain to an empty list instead of
removing each individual item
2018-03-21 16:37:10 +00:00
twangboy
8d93156604
Fix unit.returners.test_local_cache for Windows
time.time is only precise to 3 decimal places in Windows. This adds a
sleep for .25 seconds to allow the test to pass
Also fixes a lint error
2018-03-21 16:00:52 +00:00
Erik Johnson
e8582e80f2
Python 3-compatibility fix to unit test
This should not be returning a string type for stderr, since
Popen.communicate() returns a bytestring. In Python 2, the str and bytes
types are the same, but the same is not true in Python 3.

Additionally, the mocking here seems not to consider the fact that Popen
is called when runas is used to get the runas user's environment. Since
this test doesn't care about the output, we can just make the mocked
Popen.communicate() return an empty bytestring.
2018-03-20 22:09:18 -05:00
Daniel A. Wozniak
eb822f5a12
Fix file.recurse w/ clean=True #36802
Fix an endless looping but in file.recurse when clean is set to true.
This patch normalizes paths and handles the root correctly.
2018-03-20 16:12:01 -07:00
rallytime
0f728186aa
Fix pillar unit test failures: file_roots and pillar_roots environments should be lists 2018-03-20 17:49:58 -04:00
rallytime
46ba72fb1c
Fix pillar unit test failures: file_roots and pillar_roots environments should be lists 2018-03-20 17:32:21 -04:00
Nicole Thomas
83ed40c06a
Merge pull request #46619 from rallytime/merge-2017.7
[2017.7] Merge forward from 2017.7.5 to 2017.7
2018-03-20 15:03:29 -04:00
Nicole Thomas
f038e3c452
Merge pull request #46571 from garethgreenaway/46552_onfail_and_require
[2017.7] fixes to state.py
2018-03-20 09:40:03 -04:00
Nicole Thomas
7bc3c2e588
Merge pull request #46531 from terminalmage/issue44299
Fix regression in yumpkg._parse_repo_file()
2018-03-20 09:34:58 -04:00
rallytime
b03cda3cea
Merge branch '2018.3.0rc1' into '2018.3'
No conflicts.
2018-03-20 09:13:13 -04:00
rallytime
bcbddf5d07
Merge branch '2017.7.5' into '2017.7'
No conflicts.
2018-03-20 09:10:38 -04:00
Nicole Thomas
e1ade5dbb2
Merge pull request #46597 from terminalmage/fix-divergent-mongodb-states
Revert PR 41278
2018-03-19 22:02:37 -04:00
Nicole Thomas
b361bc93e8
Merge pull request #46608 from garethgreenaway/46593_schedule_present_always_triggers_change
[2018.3.0rc1] fixes to scheduler
2018-03-19 22:01:50 -04:00
Nicole Thomas
36a64ab2d8
Lint: Remove extra blank line 2018-03-19 17:03:25 -04:00
Erik Johnson
db304c3eff
Update tests to reflect changes to state returns 2018-03-19 15:18:49 -05:00
Gareth J. Greenaway
da9a9b6e37
Fixing a bug that would result in constant changes using the schedule state module when a job was added with run_on_start. Adding an eval test to test run_on_start functionality. 2018-03-19 09:23:22 -07:00
Nicole Thomas
cdd768fa4d
Merge pull request #46577 from gtmanfred/2017.7.5
Fix npm issue
2018-03-19 07:51:03 -04:00
Nicole Thomas
e6682c660c
Merge pull request #46551 from terminalmage/salt-jenkins-885
Fix failing pkg integration test on OpenSUSE
2018-03-19 07:50:11 -04:00
Nicole Thomas
e7dc802e2c
Merge branch '2018.3.0rc1' into optional_grains 2018-03-19 07:39:02 -04:00
Nicole Thomas
218b7f7a08
Merge pull request #46401 from garethgreenaway/46335_unicode_broke_the_x509_star
[2018.3.0rc1] fixes to x509 module
2018-03-16 13:57:53 -04:00
Daniel Wallace
78cbf7b5cd
Fix npm issue
Fixes saltstack/salt-jenkins#884
2018-03-16 09:04:09 -06:00
Gareth J. Greenaway
152c43c843
Accounting for a case when multiple onfails are used along with requires. Previously if you have multiple states using 'onfail' and two of those states using a 'require' against the first one state, the last two will run even if the 'onfail' isn't met because the 'require' is met because the first state returns true even though it didn't excute. This change adds an additional hidden variable that is used when checking requisities to determine if the state actually ran. 2018-03-15 17:45:42 -07:00
rallytime
8886b61576
Update old utils paths to new paths 2018-03-15 17:31:29 -04:00
rallytime
8d1e1e7f94
Merge branch '2017.7' into '2018.3'
Conflicts:
  - .kitchen.yml
  - Gemfile
  - pkg/windows/build_env_2.ps1
  - pkg/windows/build_env_3.ps1
  - pkg/windows/req.txt
  - salt/client/ssh/__init__.py
  - salt/client/ssh/ssh_py_shim.py
  - salt/modules/boto_vpc.py
  - salt/modules/file.py
  - salt/modules/heat.py
  - salt/modules/smartos_vmadm.py
  - salt/modules/win_dsc.py
  - salt/returners/elasticsearch_return.py
  - salt/runners/salt.py
  - salt/states/module.py
  - salt/utils/win_functions.py
  - setup.py
  - tests/integration/modules/test_state.py
  - tests/unit/grains/test_core.py
  - tests/unit/test_pillar.py
2018-03-15 17:22:05 -04:00
Daniel A. Wozniak
3b6901e19d Honor named tests when running integration suites 2018-03-15 13:16:43 -07:00
twangboy
50a860b839
Remove unicode things 2018-03-15 12:55:26 -06:00
Daniel Wallace
8d5ab72983
virtualenv version too old for python3.6
This test is testing an old version of virtualenv with pip_env, and the version
of pip is 6.x.x, which is too old and doesn't work with the importlib in python
3.6. Skipping this test if python is newer then 3.5.
2018-03-15 12:18:23 -06:00
twangboy
8474006dab
Fix 2 tests
Modifies the fibre_channel.py grain for linux to allow mocking. You
can't mock a file handle used in a for loop.
Fixes the mocking in test_windows_iscsi_iqn_grains. Apparently, you
can't stack multiple mocks in the same with statement.
2018-03-15 11:15:57 -06:00
Nicole Thomas
5429438e4b
Merge pull request #46513 from rallytime/merge-2018.3
[2018.3] Merge forward from 2018.3.0rc1 to 2018.3
2018-03-15 11:58:59 -04:00
Nicole Thomas
98e3260b9a
Merge pull request #46548 from Ch3LL/profit_test
profitbrick test: check for foo,bar username,password set in profitbrick config
2018-03-15 10:25:27 -04:00
Erik Johnson
010d260d06
Rewrite failing Suse pkg integration test
This makes the test less brittle by hard-coding which package to use
2018-03-14 23:35:25 -05:00
twangboy
5636ab7cd4
Fix some lint 2018-03-14 16:39:40 -06:00
twangboy
16949c0b93
Fix failing tests, add new tests 2018-03-14 16:37:42 -06:00
Ch3LL
bb338c464c
Fix dimensionsdata test random_name call 2018-03-14 15:28:06 -04:00
Ch3LL
db96c4e72e
check for foo,bar username,password set in profitbrick config 2018-03-14 14:57:48 -04:00
Erik Johnson
ce391c53f4
Add regression test for #44299 2018-03-13 21:30:14 -05:00
Frode Gundersen
1ad4d7d988
fix assert errors 2018-03-13 21:01:46 +00:00
Frode Gundersen
e6a56016df
update test 2018-03-13 20:54:25 +00:00
Erik Johnson
a8b1f0d640
Add unit test for salt-ssh edge case 2018-03-13 13:39:27 -05:00
Erik Johnson
3cd371efe6
Add with_tempfile helper from f9f187e
This helper was part of a PR that did not get ported into the 2018.3.0rc1
branch, but to help with code re-use this commit adds the helper to
2018.3.0rc1.
2018-03-13 10:41:55 -05:00
rallytime
aa760334a1
Merge branch '2018.3.0rc1' into '2018.3'
No conflicts.
2018-03-13 10:58:28 -04:00
Erik Johnson
4106840deb
user.present: don't change uid/gid unless explicitly told to
Prior to this change, this state would update the uid/gid. This change
may have been accidental, and can cause problems with file ownership. A
uid/gid change must now be explicitly requested via two new arguments to
the `user.present` state.
2018-03-12 19:30:47 -05:00
Nicole Thomas
7cdb00ca9c
Merge pull request #46398 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-03-12 16:25:18 -04:00
Nicole Thomas
22d753364b
Merge pull request #46337 from gtmanfred/2017.7
Fix using names with listen and listen_in
2018-03-12 14:49:59 -04:00
Nicole Thomas
b7191b8782
Merge pull request #46413 from meaksh/2017.7-explore-result-in-depth
Explore 'module.run' state module output in depth to catch "result" properly
2018-03-12 14:49:06 -04:00
Gareth J. Greenaway
08fce29653
Silly typo in test. 2018-03-10 06:23:00 -08:00
Gareth J. Greenaway
84d720b14c
Adding some code that was accidently reverted back in. 2018-03-10 06:21:47 -08:00
Gareth J. Greenaway
2c43911f62
Fixing lint. 2018-03-10 06:01:01 -08:00
Gareth J. Greenaway
e813b74fbe
Update test_x509.py
Lint fixes.
2018-03-10 06:01:00 -08:00
Gareth J. Greenaway
1d57787a6f
Gating the two tests that require m2crypto to be available. 2018-03-10 06:01:00 -08:00
Gareth J. Greenaway
70aca0da57
Recent unicode changes into Oxygen broke some aspects of the x509 module. When processing PEM text, it needs to be treated as ascii not unicode. Adding a couple tests for affected functions. 2018-03-10 06:01:00 -08:00
Nicole Thomas
cac096b311
Merge pull request #46434 from gtmanfred/highstate_return
split return key value correctly
2018-03-09 12:45:20 -05:00
Nicole Thomas
9c089aa4de
Merge pull request #46421 from bdrung/skip-ssh-tests-if-ssh-is-missing
Skip SSHPasswordTests if ssh binary is not found
2018-03-09 11:21:01 -05:00
Daniel Wallace
d18f1a55a7
fix pylint 2018-03-09 08:23:17 -07:00
Gareth J. Greenaway
ab02ffd4ae
Swapping out import-error for unused-import. 2018-03-09 07:13:27 -08:00
Nicole Thomas
a188984cd9
Merge pull request #46446 from bdrung/fix-typos
Fix various typos
2018-03-08 16:11:46 -05:00
Daniel Wallace
9e2c3f7991
split return key value correctly 2018-03-08 13:38:52 -07:00
Nicole Thomas
e35fc5263c
Merge pull request #46309 from bdrung/dynamic-pillarenv
Support dynamic pillar_root environment
2018-03-08 14:15:35 -05:00
Benjamin Drung
3d37eca847 Fix various spelling mistakes
lintian found various spelling mistakes.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-03-08 19:14:42 +01:00
Gareth J. Greenaway
e6c9740a7d
Gating nacl tests to ensure libnacl is installed. 2018-03-08 10:06:58 -08:00
Gareth J. Greenaway
4ae2861d68
Fixing a few bugs introducted following the move to unicode all the things. Adding deprecation notices for the previously used key and key_file arguments. Adding deprecation into Release notes. Adding some tests for Naccl module and runner to test encryption and decryption. 2018-03-08 10:06:55 -08:00
Nicole Thomas
35fe9827fe
Merge pull request #46430 from terminalmage/issue44032
Improve reliability/idempotence of file.blockreplace state
2018-03-08 10:41:37 -05:00
Benjamin Drung
a3c54b50f6 Fix various spelling mistakes
lintian found various spelling mistakes.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-03-08 15:25:42 +01:00
Benjamin Drung
584b451fd1 Support dynamic pillar_root environment
Allow users to specify a __env__ pillar_root directory that applies
equally to all environments that are not explicitly specified.

fixes #20581
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-03-08 10:12:40 +01:00
Erik Johnson
f9f187e915
Improve reliability/idempotence of file.blockreplace state
This makes the following changes:

- The `append_newline` argument to the `file.blockreplace`
  remote-execution function has been modified so that if its value is
  `None`, it only appends a newline when the content block does not end
  in one.
- A couple of fixes were made to newline handling. The existing code
  normalized the newlines in the content block, replacing them with
  os.linesep. However, when the file contains newlines that don't match
  the OS (i.e. POSIX newlines in a file on a Windows box, or Windows
  newlines on a Linux/Mac/BSD/etc. box), then we would still end up with
  mixed newlines. The line separator is now detected when we read in the
  original file, and the detected line separator is used when writing
  the content block. Additionally, the same newline mismatch was
  possible when appending/prepending the content block. This has been
  fixed by using a common function for appending, prepending, and
  replacing the content block.
- Support for the `append_newline` argument has been added to the
  `file.blockreplace` state. The default value for the state is `None`.
  A `versionchanged` has been added to the remote execution function to
  let users know that the Fluorine release will change the default value
  of that variable.
- 20 new integration tests have been written to test the
  `file.blockreplace` state.
2018-03-07 22:29:39 -06:00
Erik Johnson
4798187035
Improve reliability/idempotence of file.blockreplace state (2018.3 branch)
This makes the following changes:

- The `append_newline` argument to the `file.blockreplace`
  remote-execution function has been modified so that if its value is
  `None`, it only appends a newline when the content block does not end
  in one.
- A couple of fixes were made to newline handling. The existing code
  normalized the newlines in the content block, replacing them with
  os.linesep. However, when the file contains newlines that don't match
  the OS (i.e. POSIX newlines in a file on a Windows box, or Windows
  newlines on a Linux/Mac/BSD/etc. box), then we would still end up with
  mixed newlines. The line separator is now detected when we read in the
  original file, and the detected line separator is used when writing
  the content block. Additionally, the same newline mismatch was
  possible when appending/prepending the content block. This has been
  fixed by using a common function for appending, prepending, and
  replacing the content block.
- Support for the `append_newline` argument has been added to the
  `file.blockreplace` state. The default value for the state is `None`.
  A `versionchanged` has been added to the remote execution function to
  let users know that the Fluorine release will change the default value
  of that variable.
- 20 new integration tests have been written to test the
  `file.blockreplace` state.
2018-03-07 22:29:09 -06:00
Nicole Thomas
93a572f229
Merge pull request #46100 from jfindlay/resolv_scope
Handle IPv6 scope parameter in resolv.conf
2018-03-07 14:51:19 -05:00
Pablo Suárez Hernández
885751634e
Add new unit test to check state.apply within module.run 2018-03-07 15:43:52 +00:00
Benjamin Drung
3d6f658309 Skip SSHPasswordTests if ssh binary is not found
If the ssh binary is not found in path, SSHPasswordTests will fail:

ERROR: test_password_failure (unit.ssh.test_ssh.SSHPasswordTests)
[CPU:0.0%|MEM:54.9%]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/ssh/test_ssh.py", line 42, in test_password_failure
    client = ssh.SSH(opts)
  File "salt/client/ssh/__init__.py", line 226, in __init__
    raise salt.exceptions.SaltSystemExit('No ssh binary found in path -- ssh must be '
salt.exceptions.SaltSystemExit: None

Either SSHPasswordTests needs to be converted into a real unit test
(i.e. mocking the salt call) or this tests needs to be skipped if ssh is
not available.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-03-07 16:36:06 +01:00
Mihai Dinca
b5e508f339 Fix openscap push 2018-03-07 14:55:50 +01:00
Daniel Wallace
3620611b5b
fix unhold package for debian 2018-03-06 14:54:40 -07:00
Nicole Thomas
82cb2ea5a0
Merge pull request #46174 from twangboy/win_fix_test_git_2
Fix a unicode issue with the git module on Windows
2018-03-06 13:53:53 -05:00
rallytime
d83727fdf9
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/cli/api.py
  - salt/client/ssh/wrapper/state.py
  - salt/config/__init__.py
  - salt/crypt.py
  - salt/daemons/masterapi.py
  - salt/key.py
  - salt/loader.py
  - salt/master.py
  - salt/modules/archive.py
  - salt/modules/hipchat.py
  - salt/modules/pip.py
  - salt/modules/state.py
  - salt/modules/virt.py
  - salt/modules/x509.py
  - salt/state.py
  - salt/transport/tcp.py
  - salt/transport/zeromq.py
  - salt/utils/__init__.py
  - salt/utils/event.py
  - salt/utils/extmods.py
  - salt/utils/files.py
  - salt/utils/parsers.py
  - salt/utils/verify.py
  - tests/integration/shell/test_call.py
  - tests/unit/utils/test_args.py
2018-03-06 13:45:59 -05:00
Justin Findlay
d5561bedaf
tests.unit.grains.core add scoped IPv6 nameserver 2018-03-05 12:31:04 -08:00
Daniel Wallace
d6d9e36359
add tests for names and listen/listen_in
Closes #30115
2018-03-05 12:15:23 -07:00
Nicole Thomas
a8f2f1b063
Merge pull request #46322 from terminalmage/issue44935
yamlify_arg: don't treat leading dashes as lists
2018-03-05 10:40:16 -05:00
Nicole Thomas
88b5f7383d
Merge pull request #46242 from redbaron4/fix-46127
Pass env_vars to pip.freeze
2018-03-05 09:53:12 -05:00
Erik Johnson
85ac6a9893
yamlify_arg: don't treat leading dashes as lists
We had a similar check to ensure "foo: bar" isn't loaded as a dict, this
adds a check to ensure that we only load lists when there is a leading
bracket.
2018-03-03 15:02:12 -06:00
Nicole Thomas
241611aca5
Merge pull request #46307 from rallytime/merge-2018.3
[2018.3] Merge forward from 2018.3.0rc1 to 2018.3
2018-03-03 07:56:06 -05:00
Erik Johnson
61ab47ee70
Merge branch '2017.7' into merge-2017.7-2018.3
Conflicts:
- salt/cloud/clouds/openstack.py
- salt/daemons/masterapi.py
- salt/master.py
- salt/modules/gentoo_service.py
- salt/pillar/__init__.py
- salt/pillar/git_pillar.py
- salt/runners/cache.py
- salt/runners/git_pillar.py
- salt/runners/winrepo.py
- salt/utils/docker/__init__.py
- salt/utils/gitfs.py
2018-03-02 16:20:20 -06:00
Nicole Thomas
a0716643e4
Merge pull request #46265 from Ch3LL/profit_cloud
Add username/password to profitbricks conf for cloud tests
2018-03-02 16:40:21 -05:00
rallytime
c9fa21f62c
Merge branch '2018.3.0rc1' into '2018.3'
No conflicts.
2018-03-02 14:22:07 -05:00
Nicole Thomas
8c2c4e3316
Merge pull request #46208 from terminalmage/audit-umask-usage
Blacklist os.umask
2018-03-02 13:46:06 -05:00
Nicole Thomas
5ffa482343
Merge pull request #46285 from gtmanfred/2018.3.0rc1
fix return dict for salt-ssh if something goes wrong
2018-03-02 12:17:42 -05:00
Nicole Thomas
5416fcf6dc
Merge pull request #46275 from terminalmage/issue46274
Make sure rest_cherrypy's config is all str types on PY2
2018-03-02 12:15:33 -05:00
Erik Johnson
aeeb533225
Fix master conf test for PY3
PY3 should have no non-unicode strings, this was a bug in the test
2018-03-02 11:06:13 -06:00
Daniel Wallace
417e45686b
add unit test 2018-03-02 07:48:26 -07:00
Dmitry Kuzmenko
51c311bc1c
Payload Py3 fix and set handling. 2018-03-02 06:01:42 +03:00
Erik Johnson
2f7ae45088
Add conf file unicode test for master 2018-03-01 13:43:33 -06:00
Nicole Thomas
c490a50452
Merge pull request #45874 from GwiYeong/2017.7-local-client-hotfix
fix for local client timeout bug
2018-03-01 14:39:35 -05:00
Nicole Thomas
dc2833aa87
Merge branch '2018.3.0rc1' into bugs/46202_msgpack_custom_types_rework 2018-03-01 10:47:07 -05:00
Dheeraj
727ebe1056
Merge branch '2017.7' into fix-46127 2018-03-01 10:19:38 +05:30
Dmitry Kuzmenko
a664864ab1
Rework msgpack serialization of unsupported types in serial 2018-03-01 02:16:31 +03:00
Nicole Thomas
da60399b8f
Merge pull request #46183 from oeuftete/fix-docker-container-running-host-config-ulimits
Fix docker_container.running HostConfig Ulimits comparison
2018-02-28 17:22:11 -05:00
Nicole Thomas
7382654c70
Merge pull request #46227 from Ch3LL/smtp_file_client
Mock file_client call in smtp return test
2018-02-28 17:12:22 -05:00
Ch3LL
d4893eab4c
Add username/password to profitbricks conf for cloud tests 2018-02-28 17:09:28 -05:00
Dmitry Kuzmenko
4dfc44ac39
A basic fix for loading datetime objects with msgpack 2018-02-28 23:05:51 +03:00
Nicole Thomas
a97a3e6fb0
Merge pull request #46101 from jfindlay/openrc_ret
In OpenRC exec module, make sure to ignore retcode on status
2018-02-28 15:01:36 -05:00
Nicole Thomas
123625213e
Merge pull request #46232 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-02-28 14:16:36 -05:00
Nicole Thomas
faa90cc6c2
Merge pull request #46213 from terminalmage/unicode-opts
PY2: Remove conversion of values from config file to str types
2018-02-28 14:10:19 -05:00
Nicole Thomas
687575b582
Merge pull request #46238 from terminalmage/fds-in-fopen
Don't allow salt.utils.files.fopen() to open stdin/stdout/stderr
2018-02-28 14:08:22 -05:00
Erik Johnson
a7575aed67
Add unit test for config loading 2018-02-28 08:44:15 -06:00
Nicole Thomas
04c53f4cc4
Merge pull request #46217 from gtmanfred/2018.3.0rc1
fix ssh integration test with enable_ssh_minions
2018-02-28 09:32:21 -05:00
rallytime
04f24c1794
Lint: fix from a bad merge
The TestJinjaDefaultOptions test class ended up with the TestCustomExtensions
class definition. This changes the bad merge back to the TestCase class.
2018-02-28 09:18:27 -05:00
Dheeraj Gupta
08d1ee8baf Fix Python3 test errors 2018-02-28 16:44:29 +05:30
Dheeraj Gupta
aa9d709015 Pass env_vars to pip.freeze
pip.installed state calls pip.freeze to check for existing installation
and to verify installation post-install. This patch propagates the
env_vars passed to pip.installed to the pip.freeze function. It also modifies
existing pip unit tests to test new functionality and adds an integration test
that verifies the expected correct behavior

Fixes #46127
2018-02-28 16:44:20 +05:30
Erik Johnson
31b1d98fcb
Replace direct use of os.umask with use of existing context manager
In cases where os.umask was being used simply to get the umask, a new
helper function has been added to keep improper direct usage of os.umask
from permanenly modifying the umask.
2018-02-27 23:42:51 -06:00
Erik Johnson
586d8b0dcf
archive.extracted: don't check source file when if_missing path exists
This exits the state early with a True result when the if_missing path
exists.
2018-02-27 23:39:32 -06:00
Ken Crowell
5b09644429
Sort lists from Ulimits before comparing 2018-02-27 23:49:05 -04:00
Erik Johnson
fe1527a3c4
Don't allow salt.utils.files.fopen() to open stdin/stdout/stderr
It's like crossing the streams. h/t @garethgreenaway
2018-02-27 18:39:54 -06:00
rallytime
aad61c77bd
Update old utils paths to new paths 2018-02-27 17:20:45 -05:00
Nicole Thomas
32a0561ca8
Merge pull request #46223 from rallytime/bp-46221
Back-port #46221 to 2018.3.0rc1
2018-02-27 17:15:13 -05:00
rallytime
7243baf2c0
Merge branch '2017.7' into '2018.3'
Conflicts:
  - doc/topics/orchestrate/orchestrate_runner.rst
  - salt/grains/core.py
  - salt/modules/git.py
  - salt/pillar/ec2_pillar.py
  - salt/runner.py
  - salt/utils/ssh.py
  - tests/integration/modules/test_cp.py
  - tests/unit/grains/test_core.py
  - tests/unit/modules/test_file.py
  - tests/unit/modules/test_git.py
2018-02-27 17:13:28 -05:00
twangboy
415821eee9
Fix encoding issue 2018-02-27 14:38:07 -07:00
Ch3LL
280dc9a2b6
Mock file_client call in smtp return test 2018-02-27 16:36:38 -05:00
Erik Johnson
13abc175e1
Fix hanging tests in integration suite
A recent change to nginx appears to be causing this test to fail to
cache the test file in the temp nginx instance we've spun up. This
causes the return of cp.cache_file to be False, which in and of itself
should be enough to fail the test. But since we're not asserting on the
cp.cache_file results, flow proceeds to the next block of code, in which
we open the "file" that we cached. Some genius thought it would be a
swell idea to make io.open() successfully open a filehandle when the
path passed to it is a boolean False. When you try to read from this
filehandle, an AMAZING thing happens... It just blocks. Forever. I know,
right? Pure genius.

This commit adds an assert so that the test fails gracefully and doesn't
try to read from a bogus filehandle that SHOULDN'T EVEN EXIST.
2018-02-27 14:58:36 -05:00
Erik Johnson
0eb012659c
Fix hanging tests in integration suite
A recent change to nginx appears to be causing this test to fail to
cache the test file in the temp nginx instance we've spun up. This
causes the return of cp.cache_file to be False, which in and of itself
should be enough to fail the test. But since we're not asserting on the
cp.cache_file results, flow proceeds to the next block of code, in which
we open the "file" that we cached. Some genius thought it would be a
swell idea to make io.open() successfully open a filehandle when the
path passed to it is a boolean False. When you try to read from this
filehandle, an AMAZING thing happens... It just blocks. Forever. I know,
right? Pure genius.

This commit adds an assert so that the test fails gracefully and doesn't
try to read from a bogus filehandle that SHOULDN'T EVEN EXIST.
2018-02-27 13:32:57 -06:00
Daniel Wallace
0d340757ad
fix ssh integration test with enable_ssh_minions
Fix for MacOS
2018-02-27 10:34:54 -07:00
rallytime
776f2ea5d7
Merge branch '2018.3.0rc1' into '2018.3'
Conflicts:
  - salt/pillar/file_tree.py
  - tests/unit/modules/test_yumpkg.py
2018-02-26 11:01:42 -05:00
Nicole Thomas
605e5eff73
Merge pull request #46161 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-02-26 10:29:38 -05:00
Bo Maryniuk
f00cf88c7b Fix unit test for socket data 2018-02-26 15:04:49 +01:00
Benjamin Drung
0b445f2a37 tests: Add unit tests for _parse_os_release()
Add tests cases to fully cover _parse_os_release().

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:38:23 +01:00
Benjamin Drung
f6069b77ed Fix osfinger grain on Debian
Rework _run_os_grains_tests() to check all os grains including osfinger.
Fix osfinger on Debian (e.g. use "Debian-9" instead of
"Debian GNU/Linux-9").

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
8dde55a761 tests: Add os_grains test cases for Debian
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
ff02ab9937 tests: Add Ubuntu 17.10 (artful) os_grains test case
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
77d5356aba Fix incorrect oscodename grain on Ubuntu
Use the full content of /etc/os-release for the Ubuntu 16.04 (artful)
os_grains test case. This reveals a bug that 'oscodename' is not
correctly calculated if /etc/os-release provides PRETTY_NAME:

FAIL: test_ubuntu_os_grains (tests.unit.grains.test_core.CoreGrainsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/grains/test_core.py", line 439, in test_ubuntu_os_grains
    self._run_ubuntu_os_grains_tests(_os_release_map)
  File "tests/unit/grains/test_core.py", line 446, in _run_ubuntu_os_grains_tests
    self._run_os_grains_tests(os_release_map)
  File "tests/unit/grains/test_core.py", line 262, in _run_os_grains_tests
    self.assertEqual(os_grains.get('oscodename'), os_release_map['oscodename'])
AssertionError: 'Ubuntu 16.04.3 LTS' != 'xenial'
- Ubuntu 16.04.3 LTS
+ xenial

fixes #34423 for Ubuntu
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
7e62dc9fd2 tests: Support reading os-release files from disk
Instead of storing pre-parsed os-release files, add support for reading
os-release files from disk.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
a92ec0db1b Make _parse_os_release() always callable
To simplify running unit tests against os_data(), make the
_parse_os_release() function always callable to avoid needing to mock
os.path.isfile().

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
eee1fe5b38 tests: Dissolve _run_ubuntu_os_grains_tests
_run_ubuntu_os_grains_tests is only used once and does not provide any
useful abstraction since the introduction of _run_os_grains_tests.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
1d6ef731fe tests: Deduplicate _run_os_grains_tests()
_run_suse_os_grains_tests() and _run_ubuntu_os_grains_tests() share most
of their logic. Combine the common part in _run_os_grains_tests() and
let the remaining small parts live in their origin functions.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
rallytime
69ac94baca
Update utils paths 2018-02-24 06:55:09 -05:00
rallytime
cffbf52c10
Lint fix: remove extra line 2018-02-24 06:51:25 -05:00
Daniel Wallace
667b5b9f0c
fix unicode for mac autologin test 2018-02-23 17:00:56 -07:00
twangboy
661a0687ec
Fix git utf-8 issues for Windows
Adds the `output_encoding` option to all the functions
Defaults to `utf-8` for Windows
Fixes some utf-8 issues in the test
2018-02-23 14:49:13 -07:00
Nicole Thomas
705caa8cca
Merge pull request #46148 from rallytime/merge-2017.7
[2017.7] Merge forward from 2017.7.3 to 2017.7
2018-02-23 14:21:38 -05:00
rallytime
79bed6cff1
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/modules/cmdmod.py
  - salt/modules/reg.py
  - salt/modules/win_lgpo.py
  - salt/modules/win_path.py
  - salt/modules/win_pkg.py
  - salt/pillar/file_tree.py
  - salt/states/boto3_route53.py
  - salt/states/reg.py
  - salt/utils/win_functions.py
  - tests/unit/modules/test_kubernetes.py
  - tests/unit/modules/test_win_path.py
2018-02-23 09:50:19 -05:00
rallytime
49e49ae51b
Mark 2 tests as flaky
- integration.spm.test_man_spm.SPMManTest.test_man_spm
- integration.ssh.test_state.SSHStateTest.test_state_running
2018-02-23 09:34:14 -05:00
Nicole Thomas
e6374bf68d
Merge pull request #46149 from rallytime/bp-46145
Back-port #46145 to oxygen.rc1
2018-02-22 16:57:51 -05:00
rallytime
29468f3dce
Lint fixes 2018-02-22 14:18:28 -05:00
Erik Johnson
2b887dd77d
Update tests to reflect changes to the SaltCacheLoader 2018-02-22 10:51:36 -05:00
rallytime
25deebf7a6
Merge branch '2017.7.3' into '2017.7'
Conflicts:
  - salt/modules/git.py
2018-02-22 10:22:22 -05:00
Nicole Thomas
6b5b56d302
Merge pull request #46146 from terminalmage/update-version-2018.3.0
Update refrences to Oxygen codename to 2018.3.0
2018-02-22 09:26:01 -05:00
Nicole Thomas
391f45b5cd
Merge pull request #46005 from gtmanfred/ssh
pass opts to SSHClient for enable_ssh_minions
2018-02-22 09:10:44 -05:00
Erik Johnson
e2c4702e0c
Update tests to reflect changes to the SaltCacheLoader 2018-02-21 23:20:02 -06:00
Erik Johnson
1668a489c4
Update refrences to Oxygen codename to 2018.3.0 2018-02-21 21:47:41 -06:00
Gareth J. Greenaway
0d4647c2dd
Removing unnecessary log. 2018-02-21 13:14:05 -08:00
Gareth J. Greenaway
2df1866cc1
Adding a internal reset function to scheduler. Calling reset between schedule tests to ensure schedule is empty and it is using defaults. 2018-02-21 13:00:19 -08:00
Daniel Wallace
53d969a152
mark orch test as flaky 2018-02-21 09:41:57 -07:00
Nicole Thomas
0e63decaac
Merge pull request #46117 from Ch3LL/mac_ssh_schema
Add stringutils.to_str in test_roster_config_validate test
2018-02-21 09:57:44 -05:00
Nicole Thomas
a50bb41849
Merge pull request #46110 from isbm/isbm-iscsii-master-nonroot
IQN check for iSCSII crash on non-root Master
2018-02-21 09:56:53 -05:00
Bo Maryniuk
1b75f98a91 Catch proper exception type 2018-02-21 13:11:44 +01:00
Bo Maryniuk
5149cdbbd9 Fix unit test for py3 2018-02-21 10:53:20 +01:00
Daniel Wallace
9ce14b2a12
pass opts to SSHClient for enable_ssh_minions
Also, use ckminions to get the minions from the roster, instead of doing it in
publish.
2018-02-20 16:06:00 -07:00
Nicole Thomas
b92346645b
Merge pull request #46107 from amendlik/yumpkg-assumeyes
Add --assumeyes on YUM/DNF commands
2018-02-20 17:52:05 -05:00
Nicole Thomas
772636f67a
Merge pull request #46084 from garethgreenaway/oxygen_swap_to_datetime_objects
[oxygen] swap scheduler to use datetime objects
2018-02-20 17:51:26 -05:00
Nicole Thomas
8f245ea62e
Merge pull request #46069 from rallytime/bp-46036
Back-port #46036 to oxygen.rc1
2018-02-20 17:50:17 -05:00
Nicole Thomas
551f7a6280
Merge pull request #46057 from terminalmage/unicode-normalization
Add unicode normalization support to data/stringutils helpers
2018-02-20 16:26:09 -05:00
Ch3LL
1fd0295cca
Add stringutils.to_str in test_roster_config_validate test 2018-02-20 16:22:15 -05:00
Nicole Thomas
0dc8d17540
Merge pull request #46104 from isbm/isbm-x509fixonfix
x509 fix update
2018-02-20 16:08:23 -05:00
Nicole Thomas
7088438930
Merge pull request #46002 from isbm/isbm-zeromq17-deprecationwarning
Pyzmq 17.0.0 proper handling
2018-02-20 16:07:06 -05:00
Gareth J. Greenaway
e8b0e64bf5
Removing debugging code 2018-02-20 11:11:24 -08:00
Gareth J. Greenaway
5a90e6db9e
merge conflict 2018-02-20 10:42:40 -08:00
Gareth J. Greenaway
1a636b1c71
Fixing typo. swapping out a format string for an additional with datetime.timedelta. 2018-02-20 10:34:57 -08:00
Gareth J. Greenaway
b5bde4e904
Fixing cron based schedule logic up. Removing debugging messages. 2018-02-20 10:34:56 -08:00
Gareth J. Greenaway
e9ebfc8226
swapping the scheduler to use datetime objects internally 2018-02-20 10:34:31 -08:00
Gareth J. Greenaway
29fea7c550
Updating skip_job and postpone_job to acceept date strings. Reverting skip_explicit and run_explicit to not be prefixed by an undercore. 2018-02-20 10:01:20 -08:00
Gareth J. Greenaway
5e15c28dfa
Swapping skip_job and postpone_job to send time in date string format instead of passing datetie objects across the event bus. Updating tests tto reflect changes. Updating others which fail when run with --scheduler option but run fine individually. 2018-02-20 10:01:19 -08:00
Gareth J. Greenaway
d37ac991a6
Fixing lint, unused imports 2018-02-20 10:01:19 -08:00
Gareth J. Greenaway
2559815eb5
Adding tests for after and until. Updating schedule unit tests. Adding skip_reason and friends for those two cases. Moving them to the end for evaluation. 2018-02-20 10:01:19 -08:00
Gareth J. Greenaway
f62f93c892
Fixing typo. swapping out a format string for an additional with datetime.timedelta. 2018-02-20 10:01:18 -08:00
Gareth J. Greenaway
ed898baf37
Fixing cron based schedule logic up. Removing debugging messages. 2018-02-20 10:01:18 -08:00
Gareth J. Greenaway
bc93552884
swapping the scheduler to use datetime objects internally 2018-02-20 10:01:18 -08:00
Bo Maryniuk
201ce62c45 Fix unit test on Python3 2018-02-20 18:50:10 +01:00
Bo Maryniuk
62d2472c01 Lintfix: unused import 2018-02-20 18:49:58 +01:00
Bo Maryniuk
b24a8c3653 Use salt.utils.platform for OS detection 2018-02-20 18:36:27 +01:00
Bo Maryniuk
98cb94ae73 Update unit test on ignoring logging while file do not exist 2018-02-20 16:47:05 +01:00
Bo Maryniuk
2e76606edf Update unit test for catching out permission error 2018-02-20 16:46:43 +01:00
Bo Maryniuk
e61315c956 Update unit test to handle OSError exception 2018-02-20 16:28:00 +01:00
Bo Maryniuk
8aa0e83be6 Refactor unit test for simplicity so it does not need to be splitted in two functions 2018-02-20 15:25:54 +01:00
Bo Maryniuk
8320939f5e Add pytest 2018-02-20 15:25:19 +01:00
Bo Maryniuk
3015ed6bcb Fix unit test for testing main functionality of linux_iqn 2018-02-20 15:18:21 +01:00
Bo Maryniuk
2aa4d02677 Add unit test for linux_iqn testing, if not iscsii available 2018-02-20 15:10:11 +01:00
Bo Maryniuk
a2ba9377f6 Add unit test for grains linux_iqn when running as non-root 2018-02-20 15:03:59 +01:00
Adam Mendlik
8d9a432fb2
Add --assumeyes to yum/dnf commands in yumpkg.refresh_db
Without --assumeyes, these commands can hang waiting for
user confirmation if there is an unaccepted repository key.
2018-02-19 17:51:11 -07:00
Justin Findlay
2eef3c65a6
tests.unit.modules.gentoo_service add retcode arg 2018-02-19 11:27:11 -08:00
Bo Maryniuk
43026b67da Add unit test for x509 module on function _parse_subject 2018-02-19 15:53:42 +01:00
Benjamin Drung
dd3f936557 Fix skipping Kubernetes tests if client is not installed
When the Kubernetes client is not installed, the import of
salt.modules.kubernetes will still succeed, but HAS_LIBS will be set to
False (since the library import will be covered by a try-except clause).

Therefore expect the salt.modules.kubernetes to always succeed and check
kubernetes.HAS_LIBS instead for the presence of the kubernetes library.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-19 12:32:14 +01:00
Ch3LL
edc6243d1c
Patch salt.utils call for test_parse_localectl test 2018-02-16 15:26:06 -05:00
rallytime
2d0f81fd1b
Merge branch 'oxygen.rc1' into 'oxygen'
No conflicts.
2018-02-16 12:36:13 -05:00
rallytime
144b29f68b
Update old utils paths to new paths for oxygen 2018-02-16 10:35:22 -05:00
Erik Johnson
149e9edf8c
Mock the ssh.key_is_encrypted utils func 2018-02-16 10:29:30 -05:00
Erik Johnson
3fac72431f
git.latest: Fix regression with identity file usage
Unit test included
2018-02-16 10:25:25 -05:00
Erik Johnson
2035bc8a44
Use unicode normalization to make test work on MacOS 2018-02-15 20:27:44 -06:00
Erik Johnson
e9ddce6e26
Update unit tests to test new unicode normalization support 2018-02-15 20:27:44 -06:00
Erik Johnson
e2140d9a84
Mock the ssh.key_is_encrypted utils func 2018-02-15 14:37:50 -06:00
Nicole Thomas
edcb64de76
Merge pull request #45763 from twangboy/win_fix_path_rehash
Fix rehash function in win_path.py
2018-02-15 15:05:15 -05:00
Nicole Thomas
005539923f
Merge pull request #45811 from gtmanfred/oxygen.rc1
Fix ldap eauth
2018-02-15 14:04:47 -05:00
Erik Johnson
f2b69f703d
git.latest: Fix regression with identity file usage
Unit test included
2018-02-15 09:35:10 -06:00
Bo Maryniuk
48b40eede9 Use ZMQ switch utility in the integration tests 2018-02-15 14:04:45 +01:00
rallytime
e060a74fd8
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/cloud/clouds/dimensiondata.py
  - salt/config/__init__.py
  - salt/modules/yumpkg.py
  - salt/pillar/ec2_pillar.py
  - salt/utils/docker/__init__.py
  - salt/utils/vault.py
  - tests/integration/states/test_docker_container.py
  - tests/unit/modules/test_yumpkg.py
  - tests/unit/templates/test_jinja.py
  - tests/unit/utils/test_docker.py
2018-02-14 16:31:31 -05:00
Erik Johnson
ee6bf2e634
yumpkg: Fix a couple issues with _get_extra_opts
`_get_extra_opts()` and `_get_branch_option()` were unnecessarily
quoting the value, causing it to be interpreted as a literal quote by
`subprocess.Popen()`.

Also, because there were separate helpers for repo options,
disableexcludes, branch options, and extra options, and specifically
because `_get_extra_opts()` parses *all* kwargs, any of the options from
the other helper funcs would end up being added to the command line
twice if `_get_extra_opts()` was used.

This commit consolidates all of the kwarg inspection and CLI opts
construction to a single helper function. It also adds unit tests to
make sure that we are formatting our commands properly.

Additionally, it makes a minor fix in `refresh_db()` which was not
accounted for when we changed the osmajorrelease grain to an integer in
2017.7.0.
2018-02-14 13:36:57 -06:00
Nicole Thomas
a1f4092811
Merge pull request #46015 from rallytime/bp-45785
Back-port #45785 to 2017.7
2018-02-14 13:16:08 -05:00
Nicole Thomas
1279924f5f
Merge pull request #45991 from terminalmage/fix-duplicate-extra-opts
yumpkg: Fix a couple issues with _get_extra_opts
2018-02-14 11:48:28 -05:00
Nicole Thomas
3e18604d75
Merge pull request #45979 from isbm/isbm-parsers-loggerfix-unicode-rc1
Unicode/logger fix + bugfix: salt/utils/parsers
2018-02-14 10:39:24 -05:00
Erik Johnson
916766f651
yumpkg: Fix a couple issues with _get_extra_opts
`_get_extra_opts()` and `_get_branch_option()` were unnecessarily
quoting the value, causing it to be interpreted as a literal quote by
`subprocess.Popen()`.

Also, because there were separate helpers for repo options,
disableexcludes, branch options, and extra options, and specifically
because `_get_extra_opts()` parses *all* kwargs, any of the options from
the other helper funcs would end up being added to the command line
twice if `_get_extra_opts()` was used.

This commit consolidates all of the kwarg inspection and CLI opts
construction to a single helper function. It also adds unit tests to
make sure that we are formatting our commands properly.

Additionally, it makes a minor fix in `refresh_db()` which was not
accounted for when we changed the osmajorrelease grain to an integer in
2017.7.0.
2018-02-13 22:46:27 -06:00
Nicole Thomas
e7999e260d
Merge pull request #44892 from terminalmage/yamlloader
Force Salt's YAML loader to load all strings as unicode types
2018-02-13 17:00:37 -05:00
Erik Johnson
9d004f6512 Use mock 2.0.0 instead of unittest.mock on Python 3 (#2)
This preserves the custom mock_open we backported from unittest.mock,
but otherwise ditches unittest.mock as it does not have
MagicMock.assert_called in Python releases before 3.6.

This allows us to maintain a uniform mock version across all platforms
and Python releases.
2018-02-13 20:16:03 +01:00
Ollie Armstrong
ef6ffb1492
Resolve linting errors 2018-02-13 13:27:38 -05:00
Ollie Armstrong
8047066c46
Remove unused import 2018-02-13 13:27:38 -05:00
Ollie Armstrong
8f7c45935a
Add tests for salt.modules.selinux.fcontext_get_policy 2018-02-13 13:27:38 -05:00
Nicole Thomas
b18087cee0
Merge pull request #45711 from bdrung/fix-unicode-tests
Fix Unicode tests when run with LC_ALL=POSIX
2018-02-13 12:42:06 -05:00