Commit Graph

6788 Commits

Author SHA1 Message Date
Alexandru Bleotu
68f48d123a Added tests for salt.utils.pbm.get_placement_solver 2017-09-25 18:18:39 -04:00
Alexandru Bleotu
6b2ddffb4c Added tests for salt.utils.pbm.get_profile_manager 2017-09-25 18:18:34 -04:00
Alexandru Bleotu
dd54f8ab15 Added tests for salt.utils.vmware.get_new_service_instance_stub 2017-09-25 18:18:27 -04:00
twangboy
922e60fa67
Add os agnostic paths 2017-09-25 15:25:31 -06:00
twangboy
dc1b36b7e2
Change expected return for Windows 2017-09-25 15:06:44 -06:00
Erik Johnson
5b3be6e8af
Fix failing unit test 2017-09-25 16:06:33 -05:00
rallytime
f98a555f98
Missed updating one of the master unit test mocks 2017-09-25 15:37:38 -04:00
Alexandru Bleotu
3c26d4e3be Updated all list_differ tests to compare dicts so the key order is not assumed 2017-09-25 13:11:08 -04:00
Alexandru Bleotu
cdb028b794 Added key sorting to have deterministing string repr of RecursiveDictDiffer objects 2017-09-25 13:09:47 -04:00
rallytime
846af152b2
Update mocked values in some master/masterapi unit tests
The addition of checking for the `auth_list` in PR #43467 requires
that the mocked return of `get_auth_list` actually contains something
in the list. These mock calls need to be updated so we can check
for the SaltInvocationErrors.
2017-09-25 12:54:32 -04:00
twangboy
d73ef44cf6
Mock with uppercase KEY 2017-09-25 09:37:15 -06:00
twangboy
048e16883f
Use uppercase KEY 2017-09-25 09:37:15 -06:00
twangboy
056f3bb4c0
Use with to open temp file 2017-09-25 09:35:25 -06:00
twangboy
716e99c453
Fix py3 bytestring problems 2017-09-25 09:35:24 -06:00
twangboy
543610570c
Fix bytestring issues, fix errored tests 2017-09-25 09:35:24 -06:00
twangboy
9fe83a34a5
Remove old variable declaration 2017-09-25 09:35:23 -06:00
twangboy
c5cf5e92c1
Fix many tests 2017-09-25 09:35:23 -06:00
Jochen Breuer
85b0a8c401 Improved delete_deployment test for kubernetes module
This is a follow up of this PR: https://github.com/saltstack/salt/pull/43235

With the fix in PR 43235, we are polling the status of the deletion via
show_deployment. This is now also reflected in the tests with this change.
2017-09-25 17:29:27 +02:00
rallytime
281cbbe048
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cloud/clouds/libvirt.py
  - salt/daemons/masterapi.py
  - salt/modules/file.py
  - salt/modules/yumpkg.py
  - salt/states/archive.py
  - salt/states/file.py
  - salt/utils/files.py
  - salt/utils/minions.py
2017-09-25 09:40:18 -04:00
Alexandru Bleotu
2d2f094810 Merge branch 'develop' into dvs_states-gh 2017-09-25 11:22:45 +01:00
Mike Place
68fa74e88f Merge pull request #43571 from nadvornik/raid_add
Add missing devices to RAID array
2017-09-24 19:54:10 -06:00
Mike Place
cae79d2020 Merge pull request #43699 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-24 19:27:17 -06:00
Alexandru Bleotu
847debab7a Fix failing storage and listdiffer tests 2017-09-22 17:50:09 -04:00
Gareth J. Greenaway
ca3f77f81e Adding test_btmp_beacon. 2017-09-22 14:24:31 -07:00
Gareth J. Greenaway
6fe02e3c6c Updating btmp & wtmp beacons to work with python3. Adding ability to fire alerts for specific users & specific times. Adding some unit tests for both. 2017-09-22 14:24:31 -07:00
Silvio Moioli
d53550de35 process_count_max: add unit test 2017-09-22 21:57:04 +02:00
Silvio Moioli
04ab9a6102 process_count_max: adapt existing unit tests 2017-09-22 21:57:04 +02:00
Mike Place
3ad43a5a67 Merge pull request #43470 from alexbleotu/esxdatacenter-gh
Fix to esxdatacenter proxy
2017-09-22 13:18:54 -06:00
Mike Place
71fa000b15 Merge branch 'develop' into ssh_known_hosts_improvements 2017-09-22 13:17:23 -06:00
rallytime
03ce4d81b7
Reactor Test: Fix incorrect merge conflict resolution 2017-09-22 15:01:11 -04:00
Alexandru Bleotu
3c7c202216 Fixed assert_has_calls in vmware.utils.dvs tests 2017-09-22 14:35:21 -04:00
Alexandru Bleotu
f811523e80 pylint 2017-09-22 14:35:14 -04:00
Alexandru Bleotu
d4d6ad99c2 Added tests for salt.utils.vmware.remove_dvportgroup 2017-09-22 14:31:48 -04:00
Alexandru Bleotu
d7474f8d30 Added tests for salt.utils.vmware.update_dvportgroup 2017-09-22 14:31:46 -04:00
Alexandru Bleotu
8a84f27adf Added tests for salt.utils.vmware.create_dvportgroup 2017-09-22 14:31:41 -04:00
Alexandru Bleotu
b8bc8fd581 Added tests for salt.utils.vmware.get_uplink_dvportgroup 2017-09-22 14:31:34 -04:00
Alexandru Bleotu
82f6ae3688 Added tests for salt.utils.vmware.get_dvportgroups 2017-09-22 14:31:29 -04:00
Alexandru Bleotu
aa247b43b8 Added tests for salt.utils.vmware.set_dvs_network_resource_management_enabled 2017-09-22 14:31:24 -04:00
Alexandru Bleotu
f211874462 Added tests for salt.utils.vmware.update_dvs 2017-09-22 14:31:19 -04:00
Alexandru Bleotu
d31d98c2d3 Added tests for salt.utils.vmware.create_dvs 2017-09-22 14:31:14 -04:00
Alexandru Bleotu
4f09bf5e88 Added tests for salt.utils.vmware.get_network_folder 2017-09-22 14:31:08 -04:00
Alexandru Bleotu
3584a91692 Added tests for salt.utils.vmware.get_dvss 2017-09-22 14:31:03 -04:00
Alexandru Bleotu
173a697be2 Added comments and imports for dvs functions in salt.utils.vmware 2017-09-22 14:31:01 -04:00
Mike Place
75dd97ee50 Merge pull request #43645 from alexbleotu/cluster_states-gh
VMware cluster states + dependencies
2017-09-22 11:46:25 -06:00
rallytime
cbae45bec4
Lint: Remove extra line at end of file 2017-09-22 10:33:10 -04:00
rallytime
e0ae50e489
Merge branch '2017.7' into 'develop'
Conflicts:
  - pkg/salt.bash
  - salt/client/mixins.py
  - salt/minion.py
  - salt/modules/aptpkg.py
  - salt/modules/boto_vpc.py
  - salt/modules/win_pkg.py
  - salt/utils/reactor.py
  - tests/unit/utils/test_reactor.py
2017-09-22 10:24:04 -04:00
rallytime
fca4e5563a
Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/modules/win_pkg.py
  - tests/unit/utils/test_parsers.py
2017-09-22 09:40:03 -04:00
Mike Place
e6dc4d64df Merge pull request #43314 from twangboy/win_fix_unit.utils.test_verify
Fix `unit.utils.test_verify` for Windows
2017-09-21 16:26:12 -06:00
Mike Place
426eb92474 Merge branch 'develop' into raid_add 2017-09-21 15:37:31 -06:00
Mike Place
ed22e0f2fd Merge pull request #43507 from rallytime/replace-utils-calls
Update which and is_windows calls to use new paths
2017-09-21 14:11:21 -06:00
Vladimir Nadvornik
1c006db2a6 Fix and extend mdadm unit tests 2017-09-21 17:46:15 +02:00
Nicole Thomas
f66eb1c5ad Merge pull request #43588 from gtmanfred/do
digitalocean should be one word.
2017-09-21 09:25:38 -04:00
Daniel Wallace
2f3be5785b
there were more 2017-09-20 15:55:37 -06:00
Alexandru Bleotu
23f58c0ff3 Even more pylint 2017-09-20 17:07:17 -04:00
Alexandru Bleotu
a41b5072da more pylint 2017-09-20 13:40:36 -04:00
Daniel Wallace
f54ddae6bb
fix do test where space was seperated by a newline 2017-09-20 09:57:57 -06:00
Jochen Breuer
96f39a420b Fixed linting
Fix for "String format call with un-indexed curly braces".
2017-09-20 16:35:01 +02:00
Alexandru Bleotu
8cdaf01642 pylint 2017-09-20 09:40:22 -04:00
Alexandru Bleotu
4f4db431fa Fixed tests for the ignore_unset_values change 2017-09-20 09:40:20 -04:00
Jochen Breuer
08fba98735 Fixed several issues with the test
* Removed redundant import.
* No longer inheriting from LogSettingsParserTests.
* Replaced test class description with somethin meaninful.
* Fixed identation.

I've also moved the class to the bottom, since all the classes inheriting
from LogSettingsParserTests are in the block above.
2017-09-20 15:37:24 +02:00
Jochen Breuer
3a089e450f Added tests for pid-file deletion in DaemonMixIn
This is a follow up on this PR:
https://github.com/saltstack/salt/pull/43366

Since we can get an OSError durin PIDfile deletion with non-root users, it
would make sense to also test for this. So here are the two test cases.
One with an OSError and the other one without.
2017-09-20 14:34:30 +02:00
Alexandru Bleotu
14deb25379 Added tests for salt.utils.vmware.assign_license 2017-09-20 06:28:51 -04:00
Alexandru Bleotu
e0ae5ecd83 Added tests for salt.utils.vmware.get_assigned_licenses 2017-09-20 06:28:47 -04:00
Alexandru Bleotu
ca33adcee7 Added tests for salt.utils.vmware.add_license 2017-09-20 06:28:44 -04:00
Alexandru Bleotu
e660af495b Added tests for salt.utils.vmware.get_licenses 2017-09-20 06:28:40 -04:00
Alexandru Bleotu
e844dbceeb Added tests for salt.utils.vmware.get_license_assignment_manager 2017-09-20 06:28:37 -04:00
Alexandru Bleotu
9f566fbe9c Added tests for salt.utils.vmware.get_license_manager 2017-09-20 06:28:33 -04:00
Alexandru Bleotu
71b10b81f9 Added tests for salt.modules.vspere.rename_datastore 2017-09-20 06:28:26 -04:00
Alexandru Bleotu
643f38c98c Added tests for salt.utils.vmware.rename_datastore 2017-09-20 06:28:21 -04:00
Alexandru Bleotu
51e881e5cf Added tests for salt.utils.vmware.get_datastores 2017-09-20 06:28:18 -04:00
Alexandru Bleotu
457246a871 Added tests for salt.utils.vmware.get_storage_system 2017-09-20 06:28:14 -04:00
Alexandru Bleotu
f042334584 Added tests for list_diff 2017-09-20 06:28:03 -04:00
Alexandru Bleotu
81a02f49e8 Added tests for RecursiveDictDiffer 2017-09-20 06:28:00 -04:00
Alexandru Bleotu
0db8cbaa25 Added tests for utils.vsan._wait_for_tasks 2017-09-20 06:24:16 -04:00
Alexandru Bleotu
6a86104ec8 Added tests for salt.utils.vsan.reconfigure_cluster_vsan 2017-09-20 06:24:11 -04:00
Mike Place
56a8257558 Merge branch 'develop' into fix-nacl-decrypt 2017-09-19 18:15:43 -06:00
Mike Place
99c6375d9a Merge branch 'develop' into ssh_known_hosts_improvements 2017-09-19 18:13:20 -06:00
Mike Place
5531e2f738 Merge pull request #43489 from garethgreenaway/41510_mount_opts
Fix to mount state when options are removed
2017-09-19 18:10:47 -06:00
Daniel Wallace
3bae894306
digitalocean should be one word.
Everything on their webpage is a reference to DigitalOcean
2017-09-19 12:47:16 -06:00
Petr Michalec
ad05cc5d98
Fix names of NACL dec. methods 2017-09-19 15:46:12 +02:00
Jochen Breuer
d1b5ec098c Merge branch '2017.7' into improve-async-operation-handling-in-kubernetes-module 2017-09-19 10:44:31 +02:00
Alexei Pope Lane
ad80801d0f Improvements to SSH known_hosts module and state. 2017-09-19 13:28:48 +10:00
Alexandru Bleotu
eca796c7ad Merge branch 'develop' into esxdatacenter-gh 2017-09-16 18:00:42 +01:00
Alexandru Bleotu
55e0092519 Merge branch 'develop' into list_cluster-gh 2017-09-16 18:00:18 +01:00
Yagnik
2ccabe296e Add support for encrypted tag 2017-09-16 00:44:38 -04:00
garethgreenaway
e870ca1ef4 Merge branch 'develop' into 41510_mount_opts 2017-09-15 16:19:09 -07:00
Nicole Thomas
9a66d5cebc Merge pull request #43495 from rallytime/move_arg_utils
Move 2 arg-related utility functions into salt.utils.args.py
2017-09-15 17:29:10 -04:00
rallytime
9afc84091d Update which and is_windows calls to use new paths 2017-09-15 17:27:02 -04:00
garethgreenaway
2c091ecaae Merge branch 'develop' into 41510_mount_opts 2017-09-15 12:44:31 -07:00
Alexandru Bleotu
f1bbb84efc Merge branch 'develop' into esxdatacenter-gh 2017-09-15 20:05:03 +01:00
Alexandru Bleotu
d9b5424aab Merge branch 'develop' into list_cluster-gh 2017-09-15 20:04:33 +01:00
Mike Place
a1b871304b Merge pull request #43345 from ribx/develop
better atom extraction from portage version string
2017-09-15 12:29:25 -06:00
Mike Place
b262695301 Merge pull request #43493 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-15 12:23:09 -06:00
garethgreenaway
787f141504 Merge branch 'develop' into 41510_mount_opts 2017-09-15 08:43:06 -07:00
Alexandru Bleotu
4421744882 pylint on own code 2017-09-14 16:22:31 -04:00
Erik Johnson
792cc0eb54 Merge pull request #43203 from rallytime/fix-21969
Return a SaltInvocationError when passing incorrect function pattern for wheel/runner functions.
2017-09-14 12:17:48 -05:00
Alexandru Bleotu
d9d78fa35c Added missing decorators in utils.vmware tests 2017-09-14 12:47:55 -04:00
Alexandru Bleotu
caf9a0578b Added tests for utils.vmware.get_service_info 2017-09-14 12:47:53 -04:00
Alexandru Bleotu
2c3b4434f8 Added tests for utils.vsan.get_cluster_vsan_info 2017-09-14 12:47:48 -04:00
Alexandru Bleotu
e811eb9c85 Added tests for utils.vsan.get_vsan_cluster_config_system 2017-09-14 12:47:44 -04:00
Alexandru Bleotu
a2f84e6f39 Added tests for utils.vsan.vsan_supported 2017-09-14 12:47:41 -04:00
Alexandru Bleotu
c3d6af502b Added tests for modules.vsphere.list_cluster 2017-09-14 12:47:34 -04:00
rallytime
75abf0a2a9 Test fix: update mock util path 2017-09-14 11:01:06 -04:00
Alexandru Bleotu
15a2499d27 Added tests for salt.vsphere._get_proxy_target 2017-09-14 10:52:28 -04:00
Nicole Thomas
aee52a20e0 Lint: Add empty line at end of file 2017-09-14 09:48:09 -04:00
Robin Lutz
e1428dec5f corrected some PEP8 problems reported by jenkins 2017-09-14 14:24:54 +02:00
rallytime
acb98bbce2 Move salt.utils.argspec_report to salt.utils.args.py 2017-09-13 18:12:52 -04:00
rallytime
9df868930a Move salt.utils.arg_lookup to salt.utils.args.py 2017-09-13 17:37:49 -04:00
Nicole Thomas
f8ef7dce40 Merge pull request #43469 from alexbleotu/test_fixes-gh
Fixed several tests
2017-09-13 15:53:53 -04:00
rallytime
bfcfcd75e8 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/fileclient.py
  - salt/loader.py
  - salt/minion.py
  - salt/modules/alternatives.py
  - salt/modules/genesis.py
  - tests/unit/modules/test_hosts.py
  - tests/unit/modules/test_ini_manage.py
2017-09-13 15:15:04 -04:00
garethgreenaway
892d459f01 Merge branch 'develop' into 41510_mount_opts 2017-09-13 12:01:42 -07:00
Nicole Thomas
9ada7f626c Merge branch '2017.7' into win_fix_unit.utils.test_verify 2017-09-13 14:22:38 -04:00
Nicole Thomas
d2b13ce4c0 Merge pull request #43468 from terminalmage/git-configparser
Fix unicode handling on PR #43378
2017-09-13 13:57:17 -04:00
Gareth J. Greenaway
132b56d785 Updating mount to allow opts in the state file to be removed and have the volume remounted 2017-09-13 10:30:15 -07:00
Alexandru Bleotu
bf3785739e Fixed failing config.test_api tests for when the ROOT_DIR is / 2017-09-13 13:01:15 -04:00
Erik Johnson
4243a2211d Rewrite the reactor unit tests
These have been skipped for a while now because they didn't work
correctly. The old tests have been scrapped in favor of new ones that
test both the old and new config schema.
2017-09-13 10:35:23 -05:00
Alexandru Bleotu
449dccdaa1 pylint 2017-09-13 05:13:01 -04:00
Alexandru Bleotu
b861d5e85e pylint 2017-09-13 05:06:58 -04:00
Alexandru Bleotu
0222a5a056 Fix to vsphere tests 2017-09-12 18:43:08 -04:00
Alexandru Bleotu
afa4921d37 Fixed vsphere tests to support the esxcluster proxy 2017-09-12 18:43:05 -04:00
Alexandru Bleotu
26710fa8fc Added tests for esxcluster execution module 2017-09-12 18:42:58 -04:00
Alexandru Bleotu
4113aa3ca7 Added tests for esxcluster proxy 2017-09-12 18:42:53 -04:00
Alexandru Bleotu
0e7b8e0c92 Adjusted tests for esxdatacenter proxy 2017-09-12 18:37:04 -04:00
Alexandru Bleotu
71c5725008 Merge branch 'develop' into test_fixes-gh 2017-09-12 23:31:37 +01:00
Alexandru Bleotu
f11a618274 Fixed Linux sysctl tests to be run in a local environment 2017-09-12 18:27:28 -04:00
Alexandru Bleotu
5c3dd00692 Updated config.test_api tests to take into account a ROOT_DIR override 2017-09-12 18:27:26 -04:00
Alexandru Bleotu
4cadfdcb56 Updated kubernetes tests to be skipped if library is not loaded 2017-09-12 18:27:23 -04:00
Erik Johnson
575ce9eb73 Fix unicode handling on PR 43378
The strings passed to exceptions should not be unicode types, as this
can cause problems elsewhere when exception class instances are
referenced.
2017-09-12 16:37:15 -05:00
Nicole Thomas
1016f585f5 Merge pull request #43378 from terminalmage/git-configparser
Add a GitConfigParser class for manipulating git config files
2017-09-12 17:10:43 -04:00
Mike Place
68d2558988 Merge pull request #43096 from lyft/add-util-func-for-state-return-merging
Add utils function to merge state returns
2017-09-12 11:02:14 -06:00
Mike Place
87ffd3f105 Merge pull request #42103 from davidjoliver86/ssh-config-roster
ssh config roster for salt-ssh
2017-09-12 10:38:49 -06:00
Erik Johnson
626129f5a3 Import all of configparser into module for easier access to error classes 2017-09-12 11:37:13 -05:00
Erik Johnson
507c1b871e Add a GitConfigParser class for manipulating git config files
This class is designed to be used for (among other things) gitfs and git_pillar, to enforce config settings which reside in a git config file without resorting to using the git CLI.
2017-09-12 11:37:13 -05:00
Mike Place
1a81663e46 Merge pull request #43302 from lyft/upstream-boto_cloudfront
Upstream boto_cloudfront execution and state modules
2017-09-12 10:10:20 -06:00
Olivier Mauras
139e065ce9 New pillar/master_tops saltclass module 2017-09-12 15:53:39 +02:00
ribx
b712f971f7 Merge branch 'develop' into develop 2017-09-12 11:49:29 +02:00
Aneesh Agrawal
2e9f1999f6 Upstream boto_cloudfront execution and state modules
AWS recently added support for tagging CloudFront distributions,
which allows us to start managing them via Salt
as we can insert a Salt-controlled identifier as a `Name` tag.
(CloudFront distributions get unique IDs generated by AWS,
which we can't predict and thus use to manage them idempotently.)
2017-09-11 23:36:31 +00:00
Mike Place
08d102c869 Merge pull request #41943 from twangboy/win_unit_test_local_cache
Fix `unit.returners.test_local_cache` for Windows
2017-09-11 15:34:02 -06:00
Mike Place
50ab79f0cb Merge pull request #43424 from twangboy/win_unit_test_hosts
Fix `unit.modules.test_hosts` for Windows
2017-09-11 15:28:41 -06:00
Mike Place
2ac185b055 Merge pull request #43439 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-11 15:18:40 -06:00
Mike Place
2c28156b89 Merge pull request #41619 from skizunov/develop2
Add ability to set minion ID by module
2017-09-11 15:16:50 -06:00
Mike Place
bb8bffde1a Merge pull request #42915 from garethgreenaway/missing_minions_branch
Show missing minions in lists & nodegroups
2017-09-11 13:38:55 -06:00
Mike Place
da16b6670a Merge pull request #42752 from skizunov/develop4
Add config option to ensure jid is unique
2017-09-11 13:38:30 -06:00
Mike Place
0e42e8f9cc Merge pull request #43188 from alexbleotu/ext_pillar_config_param-gh
Ext pillar config param gh
2017-09-11 12:58:01 -06:00
Mike Place
e7a411c7f4 Merge pull request #43252 from rallytime/utils-files-moves
Move salt.utils.istextfile to salt.utils.files.is_text_file
2017-09-11 12:42:40 -06:00
rallytime
5413a5337e Lint: remove unused import 2017-09-11 14:34:20 -04:00
Mike Place
ca091bc8a4 Merge pull request #43438 from rallytime/merge-2017.7
[2017.7] Merge forward from 2016.11 to 2017.7
2017-09-11 12:33:38 -06:00
twangboy
c0dc3f73ef Use sys.platform instead of salt.utils to detect Windows 2017-09-11 12:22:06 -06:00
twangboy
e496d28cbf Fix unit.utils.test_verify for Windows
Use Windows api to get and set the maxstdio
Change messages to work with Windows
2017-09-11 12:22:06 -06:00
Mike Place
a9592dd3e2 Merge pull request #43320 from twangboy/win_fix_alternatives
Fix `unit.modules.test_alternatives` for Windows
2017-09-11 11:27:59 -06:00
Mike Place
9b89e49846 Merge pull request #43363 from twangboy/scratch_ini_tests
Fix `unit.modules.test_ini_manage` for Windows
2017-09-11 11:10:30 -06:00
rallytime
984fa35062 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/key.py
  - salt/modules/mount.py
  - salt/modules/system.py
  - tests/unit/modules/test_mount.py
  - tests/unit/modules/test_pam.py
  - tests/unit/modules/test_parted.py
2017-09-11 12:55:39 -04:00
Mike Place
2964707e5d Merge pull request #43341 from ixs/fedora-rh_ip
Fix rh_ip template use for Fedora
2017-09-11 10:30:53 -06:00
rallytime
ef7b4242c3 Merge branch '2016.11' into '2017.7'
No conflicts.
2017-09-11 12:24:10 -04:00
Mike Place
9f421dde89 Merge pull request #43370 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-11 09:38:20 -06:00
Mike Place
e89e23a32e Merge pull request #43422 from twangboy/win_unit_cloud_ec2
Fix `unit.cloud.clouds.test_ec2` for Windows
2017-09-11 09:17:19 -06:00
rallytime
e11aa7e5ef Adjust test mocking to handle __utils__['files.is_text_file'] 2017-09-11 10:25:00 -04:00
rallytime
1279556873 Move salt.utils.istextfile to salt.utils.files.is_text_file
Moves the original function to `salt.utils.files.py`, adds a deprecation
warning to the original function, and updates all of the istextfile
references in salt code.
2017-09-11 10:21:43 -04:00
Alexandru Bleotu
0882fed61a Merge branch 'develop' into ext_pillar_config_param-gh 2017-09-10 18:46:57 +01:00
twangboy
90dcf8287c Fix unit.modules.test_hosts for Windows
Fix problem with TmpStringIO Class on Windows. The module uses this
class twice in normal operation. In Windows there's an additional run
before the real runs where it is opened with mode='w'. This causes the
data to be wiped out. So, this sets it to only save the value in the
instance to data if it is not empty.

Use the windows path to the hosts file in Windows
2017-09-08 17:21:01 -06:00
twangboy
b2cea18d13 Fix unit.modules.test_gem for Windows
Mock `salt.utils.is_windows` to return False so the test will run on
Windows
2017-09-08 15:53:07 -06:00
twangboy
1379627334 Fix unit.cloud.clouds.test_ec2 for Windows
Mock instead of create tempfile
2017-09-08 15:36:52 -06:00
Alessandro -oggei- Ogier
496f14a7e7 forgot to mock the proper one 2017-09-08 21:37:09 +02:00
Nicole Thomas
97f05ff603 Merge pull request #43398 from twangboy/win_fix_test_mount
Fix `unit.modules.test_mount` for Windows
2017-09-08 09:39:28 -04:00
Nicole Thomas
6a4cc5c1b0 Merge pull request #43399 from twangboy/win_fix_test_pam
Fix `unit.modules.test_pam` for Windows
2017-09-08 09:37:49 -04:00
Nicole Thomas
2b5cfae3f8 Merge pull request #43400 from twangboy/win_unit_test_parted
Fix `unit.modules.test_parted` for Windows
2017-09-08 09:36:59 -04:00
Nicole Thomas
332deeb013 Merge pull request #43401 from twangboy/win_unit_test_pw_group
Fix `unit.modules.test_pw_group` for Windows
2017-09-08 09:35:44 -04:00
Nicole Thomas
c0f54bfef1 Merge pull request #43402 from twangboy/win_unit_test_qemu_nbd
Fix `unit.modules.test_qemu_nbd` for Windows
2017-09-08 09:34:57 -04:00
Alessandro -oggei- Ogier
70642e495d better qemu_static parameter mangle in deboostrap management, tests 2017-09-08 10:17:32 +02:00
twangboy
6ceb895a84 Use os.path.join for paths 2017-09-07 16:51:10 -06:00
twangboy
531ce8022b Fix unit.modules.test_qemu_nbd for Windows
Use os.sep
2017-09-07 15:44:35 -06:00
twangboy
78e39a1b9d Fix unit.modules.test_pw_group for Windows
Skip `test_info` and `test_getent` because they require grp which is not
available on Windows
2017-09-07 15:34:57 -06:00
twangboy
8e3e897ee2 Fix unit.modules.test_parted for Windows
Mock salt.utils.is_windows to be False so that the __virtual__ tests
will run
2017-09-07 15:27:11 -06:00
twangboy
6257aa964a Fix unit.modules.test_pam for Windows
Mocks os.path.exists
2017-09-07 15:18:14 -06:00
twangboy
4a8d7e522c Fix tests, Use full path to salt.utils.which 2017-09-07 14:41:56 -06:00
Sergey Kizunov
88ee8ad566 Add config option id_function
Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2017-09-07 13:41:10 -05:00
Sergey Kizunov
3c58717c58 Add config option to ensure jid is unique
Having a jid that is occasionally not unique (eg two processes creating
jobs at about the same time) causes problems in my usage due to
job tracking assuming unique jids. Add a config option called `unique_jid`
that will enforce unique jids, but will change the jid format by
appending an underscore and the process id.

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2017-09-07 13:25:35 -05:00
Nicole Thomas
6106aec696 Merge pull request #43356 from gtmanfred/2016.11
never-download got readded
2017-09-07 13:46:04 -04:00
Nicole Thomas
3f19b247f3 Add handler.messages back in for test comparison 2017-09-07 11:51:39 -04:00
Jochen Breuer
20619b24c4
Fixed test for delete_deployment
Due to implementation change, we need to mock the return value.
2017-09-07 10:20:46 +02:00
twangboy
a909813fa5 Remove unused import (lint) 2017-09-06 15:56:24 -06:00
twangboy
3ef8d714cb Fix unit tests to mock salt.utils.path.readlink 2017-09-06 13:03:14 -06:00
twangboy
7c4460164b Fix alternatives for Windows
Not sure this is necessary... I don't think alternatives is a thing in
Windows. Anyway, it uses `__salt__['file.readlink']` instead of
`os.readlink` as there is no `os.readlink` in Windows.
Modifies the tests to mock `__salt__['file.readlink']` instead of
`os.readlink`
2017-09-06 13:03:14 -06:00
Aneesh Agrawal
60d80e7cda Add utils function to merge state returns
This makes it possible to merge the state return
for a subresource into a main state return.
This is useful for configuring e.g. alarms to go along with a resource.
2017-09-06 18:14:04 +00:00
Alexandru Bleotu
103ef69016 Merge branch 'develop' into ext_pillar_config_param-gh 2017-09-06 18:49:37 +01:00
Alexandru Bleotu
33feda7a5b Mocked salt.utils.args.get_function_argspec instead of inspect.getargspec in all external pillar data tests 2017-09-06 12:26:40 -04:00
Nicole Thomas
7d462d29c2 Merge branch 'develop' into expand-list_pkg-attr-parameter 2017-09-06 12:15:01 -04:00
Nicole Thomas
5111cf8bad Merge branch '2016.11' into 43086-no-member 2017-09-06 10:41:18 -04:00
rallytime
5701d54516 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/state.py
  - salt/utils/gitfs.py
2017-09-06 09:39:27 -04:00
Andreas Thienemann
6aefa5c3f8 Update unit test to provide osmajorrelease grain. 2017-09-06 03:46:00 +02:00
twangboy
a94319a082 Make sure formatting of TEST_FILE_CONTENT matches original 2017-09-05 17:03:50 -06:00
twangboy
6263bc8983 Remove print statement 2017-09-05 16:48:58 -06:00
twangboy
79cd3831ae Fix empty value preserved test 2017-09-05 16:44:12 -06:00
twangboy
85997391f1 Is this handled the same on Linux and Windows 2017-09-05 16:32:43 -06:00
Nicole Thomas
f19274e1b4 Merge pull request #43222 from rallytime/oxygen-warnings-env
Remove deprecation warnings for "env"
2017-09-05 18:24:54 -04:00
Mike Place
a414325a82 Merge pull request #43070 from lyft/support-states-returning-a-list-of-comments
Support states returning a list for ret['comment']
2017-09-05 16:19:26 -06:00
Mike Place
f902bd8bc9 Merge pull request #43152 from garethgreenaway/adding_custom_beacons
Adding custom beacons with beacon module
2017-09-05 15:37:39 -06:00
rallytime
b93392dfb7 Return a SaltInvocationError when passing incorrect function pattern
When calling an incorrectly formatted wheel or runner function, we should
be raising a SaltInvocationError with a hint to check function syntax rather
that raising an Eauth authentication error.

This PR does several things:

- Adds a dictionary error return when the function syntax passed through to
`utils.minions.CkMinions.spec_check` does not match the expected `module.function`
syntax
- Handles the return of this new dictionary error (instead of previous `False` return)
wherever the spec_check function is called. This is handled up the stack in
`master.py` and `masterapi.py`.
- Reworks the runner and wheel functions in `master.py` and `masterapi.py` to
help make those functions more DRY (see `salt.auth.check_authentication` function).
- Adds tests for all of these changes (written before the runner and wheel functions
were moved to use the new salt.auth.check_authentication function)  to help prevent
regressions.
- Fixes a couple of places where unit tests exposed potential stacktraces.
- Adjusts one previous unit test concerning the dictionary error change from spec_check
2017-09-05 17:08:50 -04:00
Mike Place
6e1b541b46 Merge pull request #43232 from terminalmage/gitfs-inheritance
Improve inheritance in salt.utils.gitfs
2017-09-05 14:37:05 -06:00
Mike Place
9c57869234 Merge pull request #43276 from rallytime/utils-state-moves
Move state-related utils to salt.utils.state.py
2017-09-05 14:20:08 -06:00
Aneesh Agrawal
ba63920874 Support states returning a list for ret['comment']
Some states are complicated and multiple subparts,
or maybe cross-call into __states__ if they manage subresources.
In these cases, they will have multiple comments.
Make this more ergonomic by supporting a list of strings as the
value for ret['comment'] in state returns and documenting this.
By joining comments on newlines, it is possible to combine
single-line and multi-line comments cleanly, as opposed to e.g. commas.

The driving impetus for this is some of the boto modules.
An update to the boto_sqs module is included as an example.

Add a check that outgoing state return data has the right shape,
and add a testcase as well.
Fix the NPM state tests and the saltmod runner & wheel state functions
to comply with the prescribed format.
2017-09-05 19:52:42 +00:00
Daniel Wallace
9911b04208 fix test 2017-09-05 13:52:02 -06:00
rallytime
ed9b45ceaa Adjust a couple more tests to handle __utils__['state.check_result'] mocking 2017-09-05 10:11:11 -04:00
Robin Lutz
ba7d00f58e use dep_getkey for atom extraction to allow non existing versions and packages, added unit test to verify behaviour 2017-09-05 09:34:54 +02:00
Silvio Moioli
130c1b1c21 Merge branch 'develop' into expand-list_pkg-attr-parameter 2017-09-04 15:36:44 +02:00
twangboy
5bd5ea042a Fix unit.modules.test_chef for Windows
Mocks the __opts__ to contain cachedir
2017-09-01 14:49:50 -06:00
rallytime
4322f009cf Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/auth/__init__.py
  - salt/auth/ldap.py
  - salt/grains/metadata.py
  - salt/master.py
  - salt/modules/apache.py
  - salt/modules/dockermod.py
2017-09-01 16:37:29 -04:00
rallytime
d891433214 Adjust test mocking to handle __utils__['state.check_result'] 2017-09-01 16:09:59 -04:00
rallytime
8127bca9ed Use __utils__ where possible for moved state utils
And update all references to new state names in salt.utils.state.py
2017-09-01 16:09:59 -04:00
rallytime
4a86f23bf1 Move state-related utils to salt.utils.state.py
Moves the following functions from `salt.utils` to `salt.utils.state`:
- gen_state_tag
- search_onfail_requisites
- check_onfail_requisites
- check_state_result

Original functions have a deprecation warning added and all references
in Salt code were updated to use the new function path, including moving
some unit tests.
2017-09-01 16:09:59 -04:00
Mike Place
0e262b8c0d Merge pull request #43253 from rallytime/utils-color-moves
Move get_colors and get_color_theme to salt.utils.color.py
2017-09-01 12:44:40 -06:00
Mike Place
24962587bc Merge pull request #43269 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-01 12:12:36 -06:00
Silvio Moioli
3dc46212cc test_yumpkg: adapt to new supported attrs 2017-08-31 16:21:26 +02:00
Silvio Moioli
7b0a7432f4 test_zypper: adapt to new supported attrs 2017-08-31 16:21:26 +02:00
William Cannon
58eef3dc2c fixed dunder usage problem in unit test 2017-08-30 17:00:27 -05:00
Nicole Thomas
bab9a49418 Merge branch 'develop' into ext_pillar_config_param-gh 2017-08-30 17:44:41 -04:00
wcannon
c080b263d5 Merge branch 'develop' into develop 2017-08-30 15:54:57 -05:00
Nicole Thomas
479e0e06ac Merge pull request #42975 from brejoc/tests-for-kubernetes-module
Added unit tests for Kubernetes module
2017-08-30 16:30:15 -04:00
Nicole Thomas
ca7df1d4cf Merge pull request #43176 from terminalmage/issue42935
docker_image states: Handle Hub images prefixed with "docker.io/"
2017-08-30 16:08:13 -04:00
Nicole Thomas
fdad9177b5 Merge branch '2017.7' into tests-for-kubernetes-module 2017-08-30 14:47:37 -04:00
Nicole Thomas
3777b34572 Merge branch '2017.7' into win_unit_test_local_cache 2017-08-30 12:16:52 -04:00
rallytime
14f5e5e023 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/augeas_cfg.py
  - salt/modules/inspectlib/collector.py
2017-08-30 12:16:28 -04:00
Nicole Thomas
ec1bedc646 Merge pull request #43254 from twangboy/win_fix_test_inspect_collector
Fix `unit.modules.test_inspect_collector` on Windows
2017-08-30 11:46:07 -04:00
Nicole Thomas
25666f88f7 Merge pull request #43251 from twangboy/win_skip_test_groupadd
Skips `unit.modules.test_groupadd` on Windows
2017-08-30 09:56:36 -04:00
twangboy
cec627a60b Skip mac tests for user and group
They use grp and pwd
2017-08-29 16:28:12 -06:00
twangboy
b401340e6c Fix unit.modules.test_inspect_collector on Windows
Uses os.sep instead of unix-style paths in the test
Uses salt.utils.path.islink() to detect symlinks instead of
os.path.islink(). os.path.islink() does not correctly detect symlinks in
Windows
Put grp and pwd imports inside a try/except block
2017-08-29 15:59:08 -06:00
rallytime
26f52bd2b8 Move get_colors and get_color_theme to salt.utils.color.py
Moves the `get_colors` and `get_color_theme` out of `salt.utils.py`
and into a new file named `salt.utils.color.py`.

This PR moves the original functions, adds a deprecation warning to
the old function paths, and updates any references to the functions
in Salt code to the new location. This includes moving a test as well.
2017-08-29 17:33:01 -04:00
twangboy
5185071d5a Skips unit.modules.test_groupadd on Windows
There is a test_win_groupadd modules for testing the win_groupadd module
on Windows.
2017-08-29 14:29:50 -06:00
rallytime
26410c662f Update some salt.utils.x paths for moved util functions
Through merge forwards, some of the old-style paths have made their
way into develop. This PR corrects some of these instances on the more
popular functions.
2017-08-29 16:24:47 -04:00
twangboy
c956d24283 Fix is_windows detection when USERNAME missing 2017-08-29 10:16:21 -06:00
twangboy
869e8cc603 Fix unit.fileserver.test_gitfs for Windows
Put `import pwd` in a try/except block
Set `os.environ['USERNAME']` in windows using win_functions
Add error function for `shutil.rmtree`
2017-08-29 10:16:21 -06:00
Jochen Breuer
c227cb25ad
Skipping test on ImportError
This most probably means that the Kubernetes client lib is not
installed.
2017-08-29 17:12:25 +02:00
Erik Johnson
53bd3a3e23 Improve inheritance in salt.utils.gitfs
This makes the following changes:

1. Renames the valid_providers param in GitBase to git_providers,
   allowing for a dictionary mapping provider names to their associated
   classes. This allows for alternate providers to be used with a
   GitBase subclass.
2. Renames the get_provider function to verify_provider to reduce
   confusion with git_providers.
3. Uses super() to run a parent class' dunder init instead of invoking
   the parent class directly.
2017-08-28 21:49:42 -05:00
rallytime
375b1faa92 Remove deprecation warnings for "env"
Removal of these deprecation warnings has no behavioral effect, as
support for "env" instead of "saltenv" in these cases has already
been removed. Only the warning text will no longer display to users.
2017-08-28 10:37:05 -04:00
rallytime
6fad40454a Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/aptpkg.py
  - salt/utils/napalm.py
2017-08-28 09:28:41 -04:00
rallytime
3911df2f4b Merge branch '2016.11' into '2017.7'
No conflicts.
2017-08-28 09:25:49 -04:00
Nicole Thomas
df18a89836 Lint: Remove unused import 2017-08-28 09:21:52 -04:00
Jochen Breuer
bd76a870ce
Dunder vars are now defined via setup_loader_modules 2017-08-28 14:17:00 +02:00
Mike Place
ce04ab4286 Merge pull request #42997 from twangboy/win_fix_test_module_names
Fix `unit.test_test_module_names` for Windows
2017-08-25 15:19:10 -06:00
Alexandru Bleotu
dc082a2087 pylint fix and fix when calling _external_pillar_data function 2017-08-25 06:41:30 -04:00
Alexandru Bleotu
a771dd94f3 Added tests for external pillar function calls 2017-08-25 06:41:27 -04:00
Alexandru Bleotu
2090d9d32f Added tests for AsyncRemotePillar adding extra minion data from config 2017-08-25 06:41:25 -04:00
Alexandru Bleotu
5b383f0036 Added tests for RemotePillar adding extra minion data from config 2017-08-25 06:41:23 -04:00
Erik Johnson
7279f98e92 docker_image states: Handle Hub images prefixed with "docker.io/"
On some platforms, for reason which I do not yet grok, images pulled
from the Hub are prefixed with "docker.io/". This causes the
docker_image states to fail unless the user manually adds "docker.io/"
before the image name.

This commit adds a new function called "docker.resolve_tag" which
disambiguates this variance and allows images to be specified without
the "docker.io/" prefix.

Resolves #42935.
2017-08-25 00:06:28 -05:00
garethgreenaway
d3cb78e74e Merge branch 'develop' into adding_custom_beacons 2017-08-24 17:25:13 -07:00
Nicole Thomas
a6a327b1e5 Merge pull request #43155 from terminalmage/issue43001
Resolve image ID during container comparison
2017-08-24 18:09:46 -04:00
garethgreenaway
0186835ebf Fix docstring in test 2017-08-24 17:08:52 -05:00
rallytime
3d0d9110ac Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/pillar/git_pillar.py
  - salt/utils/files.py
  - salt/utils/process.py
  - tests/unit/utils/test_which.py
2017-08-24 15:33:15 -04:00
garethgreenaway
a0bb654e46 Fixing lint issues 2017-08-24 12:09:29 -07:00
Gareth J. Greenaway
41790d4f28 Missing the test_add Beacon test. 2017-08-24 10:24:27 -07:00