Commit Graph

3750 Commits

Author SHA1 Message Date
Nicole Thomas
8331d51628
Merge pull request #45041 from terminalmage/add-print_function
[PY3] Add print_function import to files with unicode_literals already added
2017-12-18 11:45:26 -05:00
rallytime
0b29da34b8
Merge branch 'oxygen' into 'develop'
Conflicts:
  - tests/unit/modules/test_status.py
2017-12-18 09:41:55 -05:00
Nicole Thomas
5bd7854d27
Merge pull request #45042 from rallytime/py3-rsync-tests
Fix a couple of PY3 test failures in the rsync module
2017-12-16 08:18:24 -05:00
Nicole Thomas
04a2ea8cd1
Merge pull request #45019 from rallytime/merge-oxygen
[oxygen] Merge forward from 2017.7 to oxygen
2017-12-16 08:16:57 -05:00
Ahmed AbouZaid
c9577f4762
add test for defaults.update function 2017-12-16 02:03:43 +01:00
rallytime
ecb1e3cf82
Fix a couple of PY3 test failures in the rsync module
Fixes:
  - unit.modules.test_rsync.RsyncTestCase.test_rsync
  - unit.modules.test_rsync.RsyncTestCase.test_version
2017-12-15 14:32:32 -05:00
Erik Johnson
8cdb9ea54f
[PY3] Add print_function import to files with unicode_literals already added
This makes the 2.x usage invalid syntax and forces the use of print as a
function. This adds the import to the files which I've updated in the
last couple of days but forgot to add it.
2017-12-15 12:14:18 -06:00
Nicole Thomas
abf34064a1
Merge pull request #44916 from jasperla/status/openbsd/meminfo
status.meminfo: add OpenBSD support
2017-12-15 12:25:56 -05:00
Erik Johnson
239fc8d774
[PY3] Add unicode literals to the clients and associated files/tests 2017-12-15 00:19:55 -06:00
Nicole Thomas
653ad2a224
Merge pull request #44946 from terminalmage/unicode-file
[PY3] Update file state/execution modules and associated files with unicode_literals
2017-12-14 16:26:50 -05:00
rallytime
3e319d50b3
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - README.rst
  - salt/modules/win_pkg.py
  - salt/utils/process.py
2017-12-14 13:01:29 -05:00
Jasper Lievisse Adriaanse
5d4d1e29ff
status.meminfo: add OpenBSD support 2017-12-14 18:00:27 +01:00
Jasper Lievisse Adriaanse
652964a4c2
status.w: rework to support Darwin/BSD
This adds support for Darwin/FreeBSD/OpenBSD where the output
does not contain several fields that Linux emits.

While here add the `from` field on BSD which is reliably populated
in the BSD implementation. Local logins are tracked as `-` or
the X Windows display.
For Linux skip `from` completely as it may be empty on local logins.
2017-12-14 17:44:14 +01:00
Nicole Thomas
ae8dd2e202
Merge pull request #44982 from terminalmage/docker-unicode
[PY3] Add unicode_literals to docker state/execution modules
2017-12-14 11:03:15 -05:00
Nicole Thomas
1bd260a663
Merge pull request #44821 from jasperla/status/openbsd/cpuinfo
make status.cpuinfo work on non-FreeBSD
2017-12-14 09:29:27 -05:00
Nicole Thomas
d9a0c02cea
Merge pull request #44877 from terminalmage/os.walk
Replace os.walk with a helper function
2017-12-14 09:09:56 -05:00
Nicole Thomas
95f0be2116
Merge pull request #44950 from gtmanfred/route53
Add Healthcheck for route53 module
2017-12-14 09:02:54 -05:00
Jasper Lievisse Adriaanse
fe7f0b5fcc
status.cpuinfo: unbreak on OpenBSD and add NetBSD support
the field separator on OpenBSD and NetBSD is '=', not ':'.
verified on OpenBSD, assuming this now works on NetBSD based on
upstream documentation for sysctl(8)
2017-12-14 07:56:39 +01:00
Erik Johnson
5e1f75aab0
[PY3] Add unicode_literals to docker state/execution modules 2017-12-13 22:49:23 -06:00
Daniel Wallace
ba98043de9
fix test 2017-12-13 17:18:02 -07:00
Erik Johnson
1bfc53fc57
Update file state/execution modules and associated files with unicode_literals
This updates the file state and execution modules to use
unicode_literals. Since the serializers and the cmd module are touched
by the file state/exec module, those are also updated here, as well as
the cmd state module, for good measure.

Additionally, I found that salt.utils.data.decode_dict (and decode_list)
are misnamed for what they actually do. Since they *encode* the
contents, the functions should be named encode_dict and encode_list,
respectively. And we also should have counterparts which actually
decode, so I've added them. The compatibility functions from salt.utils
still use the old "decode" names to preserve backward compatibility, but
they now invoke the renamed "encode" functions in salt.utils.data. Note
that this means that the compatibility functions
salt.utils.decode_dict/list, and their cognates in salt.utils.data now
do different things, but since the move to salt.utils.data is also
happening in the Oxygen release this is as good a time as any to correct
this oversight.

I've updated the jinja filter docs to include information on the renamed
jinja filters, and also added a section on jinja filter renaming to the
Oxygen release notes. There was another filter that I renamed during the
process of moving functions from salt.utils which I did not properly
document in the release notes, so this is now included along with the
others.
2017-12-13 16:43:45 -06:00
Erik Johnson
6d52aeb739
Replace os.walk with a helper function
On PY2, when os.walk is invoked with a str as input, the paths in the
return data are all str types as well. This leaves undecoded unicode
data in those strings when files/dirs under the top dir that was passed
contain unicode characters in the filename.

>>> import os
>>> list(os.walk('temp'))
[('temp', [], ['\xd0\x94.txt', 'foo.txt'])]
>>> list(os.walk(u'temp'))
[(u'temp', [], [u'\u0414.txt', u'foo.txt'])]

The helper introduced here ensures that we always invoke os.walk with a
unicode top-level dir, so that we get unicode types in the return data.
2017-12-13 16:38:12 -06:00
Nicole Thomas
a8fa393459
Merge pull request #44915 from jasperla/status/openbsd/cpustats
status.cpustats: add OpenBSD support
2017-12-13 17:17:43 -05:00
Jasper Lievisse Adriaanse
729422ea41
status.cpustats: add OpenBSD support 2017-12-13 20:21:03 +01:00
Daniel Wallace
2cc8c5541e
fix pylint 2017-12-12 13:50:21 -07:00
Daniel Wallace
1e51d08d91
remove extra config 2017-12-12 12:50:53 -07:00
Daniel Wallace
f29de36cf8
add test 2017-12-12 12:47:31 -07:00
Daniel Wallace
8689b531e4
add boto route53 test, error catch and docs 2017-12-12 12:47:31 -07:00
Daniel Wallace
66bb755751
add test for effective acls 2017-12-12 09:58:08 -07:00
rallytime
0a2f47a850
Fix merge conflict resolution error: test_napalm_network
There were merge conflicts in this file during the merge forward, which
I resolved incorrectly. This brings the test module into the proper state.
2017-12-12 09:49:18 -05:00
rallytime
db5866d097
Update old utils paths to new utils paths 2017-12-11 18:43:33 -05:00
rallytime
08c71f13e4
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - doc/ref/configuration/minion.rst
  - doc/topics/thorium/index.rst
  - salt/beacons/__init__.py
  - salt/client/mixins.py
  - salt/client/ssh/wrapper/state.py
  - salt/daemons/masterapi.py
  - salt/grains/extra.py
  - salt/minion.py
  - salt/modules/cron.py
  - salt/modules/file.py
  - salt/modules/mac_user.py
  - salt/modules/napalm_network.py
  - salt/modules/state.py
  - salt/modules/win_file.py
  - salt/modules/win_pkg.py
  - salt/proxy/dummy.py
  - salt/state.py
  - salt/states/file.py
  - salt/states/lxc.py
  - salt/utils/__init__.py
  - salt/utils/schedule.py
  - tests/integration/modules/test_file.py
  - tests/integration/modules/test_groupadd.py
  - tests/integration/ssh/test_state.py
  - tests/integration/states/test_file.py
  - tests/unit/daemons/test_masterapi.py
  - tests/unit/grains/test_core.py
  - tests/unit/modules/test_disk.py
  - tests/unit/modules/test_napalm_network.py
  - tests/unit/modules/test_state.py
  - tests/unit/test_minion.py
  - tests/unit/utils/test_process.py
2017-12-11 18:24:41 -05:00
Gareth J. Greenaway
5da900db19
Merge branch 'develop' into defaults_merge_enhancements 2017-12-09 10:29:07 -08:00
Ahmed AbouZaid
4057256728
pep8 complaint 2017-12-09 01:06:39 +01:00
Nicole Thomas
2a2fad5037
Merge pull request #44818 from Ch3LL/test_true_minion
Allow test arg to be used on master or pillar
2017-12-08 17:36:25 -05:00
Nicole Thomas
f5a143f8c5
Merge pull request #44621 from isbm/isbm-bsc1068446-2017.7
Bugfix: errors in external pillar causes crash, instead of report of them
2017-12-08 13:46:55 -05:00
Gareth J. Greenaway
a380561180
Merge branch 'develop' into issue30842 2017-12-08 09:32:39 -08:00
Nicole Thomas
5b579459a8
Merge pull request #44796 from sjorge/issue44404
Fix for Issue #44404
2017-12-07 16:42:11 -05:00
Nicole Thomas
53eee476ac
Merge pull request #44638 from terminalmage/new-docker-hotness
Many improvements to docker network and container states
2017-12-07 15:50:55 -05:00
Gareth J. Greenaway
13dd5c3095
Merge branch 'develop' into issue30842 2017-12-07 12:46:15 -08:00
Nicole Thomas
15d9a8d3e0
Merge pull request #44644 from mchugh19/fixpip
Correct pip parsing
2017-12-07 15:44:13 -05:00
Ahmed AbouZaid
3e96abaa8d
Merge branch 'develop' of https://github.com/saltstack/salt into defaults_merge_enhancements 2017-12-07 20:28:55 +01:00
Nicole Thomas
b6173d6ada
Merge pull request #44851 from AAbouZaid/defaults_deepcopy
Add defaults.deepcopy function.
2017-12-07 11:02:53 -05:00
Nicole Thomas
2458e18f47
Merge branch 'develop' into fixpip 2017-12-07 10:56:58 -05:00
Nicole Thomas
3b57e306db
Merge branch 'develop' into test_true_minion 2017-12-07 10:23:06 -05:00
Jorge Schrauwen
40f3a6f053
Merge branch 'develop' into issue44404 2017-12-06 20:25:14 +01:00
Erik Johnson
4908cf74e0
More conversion to __utils__
Also, actually using __utils__ here revealed several import errors in
utils modules, so these needed to be dealt with.
2017-12-06 13:14:02 -06:00
Erik Johnson
64aa4fbbec
Many improvements to docker network and container states
Much Improved Support for Docker Networking
===========================================

The `docker_network.present` state has undergone a full rewrite, which
includes the following improvements:

Full API Support for Network Management
---------------------------------------

The improvements made to input handling in the
`docker_container.running` state for 2017.7.0 have now been expanded to
docker_network.present`.  This brings with it full support for all
tunable configuration arguments.

Custom Subnets
--------------

Custom subnets can now be configured. Both IPv4 and mixed IPv4/IPv6
networks are supported.

Network Configuration in :py:func:`docker_container.running` States
-------------------------------------------------------------------

It is now possible to configure static IPv4/IPv6 addresses, as well as
links and labels.

Improved Handling of Images from Custom Registries
==================================================

Rather than attempting to parse the tag from the passed image name, Salt
will now resolve that tag down to an image ID and use that ID instead.

Due to this change, there are some backward-incompatible changes to
image management. See below for a full list of these changes.

Backward-incompatible Changes to Docker Image Management
--------------------------------------------------------

Passing image names to the following functions must now be done using separate
`repository` and `tag` arguments:

- `docker.build`
- `docker.commit`
- `docker.import`
- `docker.load`
- `docker.tag`
- `docker.sls_build`

Additionally, the `tag` argument must now be explicitly passed to the
`docker_image.present` state, unless the image is being pulled from a
docker registry.
2017-12-06 12:12:25 -06:00
Ahmed AbouZaid
aa9e505588 write unit test for defaults.merge not in place 2017-12-06 18:30:50 +01:00
Jorge Schrauwen
6324339fc6
Merge branch 'develop' into issue44404 2017-12-06 17:23:21 +01:00
Ahmed AbouZaid
2c51005810 write unit test for defaults.deepcopy 2017-12-06 16:57:55 +01:00
Ahmed AbouZaid
6af5cd844f write unit test for defaults.merge 2017-12-06 15:43:30 +01:00
Nicole Thomas
d20b3e458a
Merge branch 'develop' into issue30842 2017-12-06 09:28:06 -05:00
Anthony Shaw
6231d69f85
Merge remote-tracking branch 'origin/develop' into more_napalm_tests 2017-12-06 15:12:35 +11:00
Nicole Thomas
45573a1fdf
Merge pull request #44627 from mstagi/add-vmware-vm-management
Add vmware vm management
2017-12-05 18:07:03 -05:00
Erik Johnson
01a76919cb
Add hide_output option to cmd state/exec module
We have `output_loglevel` for controlling logging, but no corresponding
option to suppress the output from the command from being returned. This
adds a `hide_output` option to do that.

Additionally, this removes the rest of the references to the
long-since-deprecated `quiet` argument from the cmd execution module,
and adds a warning to states which use this argument. `quiet` appears to
have been incompletely removed following its deprecation. It was not
being passed to _check_loglevel(), so it was essentially ignored, but it
was still being accepted as an argument by several functions. Those
references to what has for some time now been a no-op argument are now
removed.
2017-12-05 16:10:02 -06:00
Nicole Thomas
49464dc755
Merge branch 'develop' into fixpip 2017-12-05 16:04:36 -05:00
Jorge Schrauwen
18272955ee
Merge branch 'develop' into issue44404 2017-12-05 21:11:09 +01:00
Ch3LL
cdbacfaf5c
Remove minions_state_test arg and use default test arg 2017-12-05 14:12:24 -05:00
Ch3LL
499541a8e8
Add new option minions_state_test to enable test on master side 2017-12-05 14:12:20 -05:00
Nicole Thomas
8e2e1f957e
Merge pull request #44772 from terminalmage/issue36275
Rename environment config option to saltenv, introduce lock_saltenv option
2017-12-04 16:49:23 -05:00
Nicole Thomas
2ad2d4e27d
Merge branch 'develop' into add-vmware-vm-management 2017-12-04 16:41:37 -05:00
twangboy
d5dd42aebe
Fix integration tests for Windows 2017-12-04 14:05:53 -07:00
twangboy
a24b964ea5
Fix unit test to handle new Exception 2017-12-04 14:05:52 -07:00
twangboy
4602f499a2
Remove loader module mixin, add linux paths 2017-12-04 14:05:52 -07:00
twangboy
99b27c037f
Add tests to avoid future regression 2017-12-04 14:05:51 -07:00
Bo Maryniuk
0d2675c4fe Use variable, instead of direct value 2017-12-04 15:51:56 +01:00
Bo Maryniuk
1ddc47da0a Add unit test for _get_pillar_errors when external pillar is clean and internal contains errors 2017-12-04 15:51:56 +01:00
Bo Maryniuk
68480d5dc9 Add unit test for _get_pillar_errors when both external and internal pillars contains errors 2017-12-04 15:51:56 +01:00
Bo Maryniuk
218a59e93b Add unit test for _get_pillar_errors when external pillar has errors and internal is clean 2017-12-04 15:51:56 +01:00
Bo Maryniuk
3ce19356c2 Add unit test for _get_pillar_errors when external and internal pillars are clean 2017-12-04 15:51:56 +01:00
Bo Maryniuk
67034139d9 Fix unit test: wrong error types in side effect 2017-12-04 15:51:56 +01:00
Bo Maryniuk
d9359bca13 Bugfix: unit test mistakenly expects pillar errors as a string, while it is a list 2017-12-04 15:51:56 +01:00
Michael Calmer
b6365aee3c fix order of parameters in unit tests 2017-12-04 15:38:22 +01:00
Jorge Schrauwen
9e163c847e Only update props when changed in zpool.present
We make sure the values conform to what zfs expects, this should
fix the unneeded updates as mentioned in #44404

Additional test for zpool.get with whitespaces in the result.
2017-12-02 16:00:06 +01:00
Jorge Schrauwen
0e9fe895e3 Add new unit tests for zfs.list and zfs.get
Parsable output needs new unit tests. I update the old tests with fresh
data from one of my test systems and create new tests for the same data
but with the parsable output flag set. These tests also test the new
code that converts numbers to actually numeric values.
2017-12-02 13:42:19 +01:00
Jorge Schrauwen
0813183fe8 Add new unit tests for zpool.list and zpool.get
Parsable output needs new unit tests. I update the old tests with fresh
data from one of my test systems and create new tests for the same data
but with the parsable output flag set. These tests also test the new
code that converts numbers to actually numeric values.
2017-12-02 13:09:38 +01:00
twangboy
5615862f23
Fix some lint 2017-12-01 10:25:48 -07:00
twangboy
627d5ab0c9
Mock salt.utils.which
cmd.run return values are mocked
2017-12-01 10:25:48 -07:00
twangboy
e5a96fe00f
Skip test_fstype on Windows
no lsblk on Windows
2017-12-01 10:25:48 -07:00
Agnes Tevesz
a517550bc3 Added to tests.modules.test_vsphere the esxvm compatibility for tests 2017-12-01 11:23:27 +01:00
Bo Maryniuk
e1eec2c69d Add unit test for __virtual__ in case Ansible is installed on the Minion 2017-12-01 11:21:27 +01:00
Bo Maryniuk
fa21af69dd Add unit test for __virtual__ in case Ansible is not installed on the Minion 2017-12-01 11:21:27 +01:00
Erik Johnson
c1e4bea83e
Change lock message 2017-11-30 14:30:44 -06:00
Erik Johnson
3770cd7dd3
Add unit test for lock_saltenv
Also move up the _get_opts in state.pkg to make it easier to unit test
2017-11-30 14:28:09 -06:00
Anthony Shaw
a029f70cff
merge inbound, resolve conflict and remove unfinished state test module 2017-11-29 08:21:53 +11:00
Zach Moody
1faa685d9e fixup pylint import error. 2017-11-27 19:05:51 -06:00
Zach Moody
871a90cbc5 add netbox execution module 2017-11-27 18:59:06 -06:00
Christian McHugh
249987f750 merge with develop 2017-11-27 22:04:59 +00:00
Nicole Thomas
cae5309752
Merge pull request #44646 from mchugh19/pip-is_installed
add is_installed function
2017-11-27 14:40:55 -05:00
Erik Johnson
8ee5e57fee
Merge pull request #44649 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-11-27 11:23:29 -06:00
Nicole Thomas
9e45e4eff9
Lint: Remove extra blank lines 2017-11-27 11:25:05 -05:00
Anthony Shaw
b95750e31c
fix minor linting errors 2017-11-25 19:04:57 +11:00
Anthony Shaw
8fd459af74
complete tests for napalm_yang_mod 2017-11-25 04:06:36 +11:00
Anthony Shaw
92ef7c555b
test for napalm_yang_mod 2017-11-25 03:48:22 +11:00
Anthony Shaw
7376d631f5
add napalm_users tests 2017-11-24 17:13:59 +01:00
Anthony Shaw
8da1aafb00
add napalm_snmp tests 2017-11-24 17:13:44 +01:00
Anthony Shaw
a8c3f1bd35
add napalm_route tests 2017-11-24 17:13:30 +01:00
Anthony Shaw
c7106d646c
complete tests for napalm_probes 2017-11-24 16:48:06 +01:00
Anthony Shaw
136816c109
fix missing commas in docstrings 2017-11-24 16:36:38 +01:00
Anthony Shaw
dd682106cd
add module for testing napalm_probes 2017-11-24 16:34:40 +01:00
Anthony Shaw
452a8965a3
complete coverage for NTP module 2017-11-24 16:34:16 +01:00
Christian McHugh
590834a136 Use json format with newer pip versions (> 9)
Add unit tests for both pip > 9 and legacy
2017-11-23 22:27:23 +00:00
Jorge Schrauwen
a94edecc93
Merge branch 'develop' into zpoolupdate 2017-11-23 16:53:41 +01:00
Christian McHugh
ab5520fdf7 add true and false test for is_installed 2017-11-23 14:08:46 +00:00
rallytime
052b13c98e
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cli/daemons.py
  - salt/client/ssh/__init__.py
  - salt/modules/win_pkg.py
  - salt/netapi/rest_cherrypy/app.py
  - salt/proxy/fx2.py
  - salt/utils/__init__.py
  - salt/utils/jinja.py
  - salt/utils/napalm.py
  - salt/utils/path.py
  - salt/utils/verify.py
  - tests/integration/modules/test_saltutil.py
  - tests/integration/states/test_service.py
  - tests/unit/utils/test_verify.py
2017-11-22 12:36:03 -05:00
Nicole Thomas
6d861f9a74
Disable pylint warning 2017-11-22 10:36:21 -05:00
Mircea Ulinic
3a0945ce3d
Merge pull request #11 from tonybaloney/gh_44332_clone
Thanks @tonybaloney
2017-11-22 10:41:01 +00:00
Anthony Shaw
dfdb43780d
coverage for ntp testing 2017-11-22 11:36:22 +01:00
Anthony Shaw
5ce67c8a7b
setup all tests for napalm_acl module 2017-11-22 09:01:26 +00:00
Anthony Shaw
40431228c8
Add test module for napalm_acl 2017-11-22 08:41:39 +00:00
Anthony Shaw
cd8d87c61f
create a common module for napalm tests, setup napalm_bgp tests 2017-11-22 08:37:56 +00:00
Anthony Shaw
88ef9f18fc
ignore lint error on import 2017-11-22 08:11:07 +00:00
Anthony Shaw
25427d845e
convert key iterator to list as python 3 wont index an iterator 2017-11-22 08:10:36 +00:00
Nicole Thomas
bce50154e5
Merge branch '2017.7' into improve-net-load 2017-11-20 10:59:54 -05:00
Roald Nefs
47147e2769
Added new Telegram module
Added a new Telegram module, which allows to send a message via Telegram
using the Telegram Bot API. The commit also includes:
- Update for the Telegram returner (merged in #44148); the Telegram
returner now fully utilizes the Telegram module.
- Update to the documentation in order to add the Telegram module to the
list list of all modules.
- Updated Telegram returner test.
- New Telegram module test.
2017-11-20 08:47:57 +01:00
Jorge Schrauwen
409acc1b1b Also add tests for zpool.scrub 2017-11-19 12:16:29 +01:00
Jorge Schrauwen
64e0b45e51 Add tests for zpool.labelclear and zpool.split 2017-11-19 12:09:36 +01:00
Anita Krueger
d3c4f6026b
Adding nexus state and module including unit tests 2017-11-18 15:31:37 +00:00
Nicole Thomas
4315c20195
Merge branch 'develop' into add-mandrill-mod 2017-11-14 17:29:52 -05:00
Nicole Thomas
2c6f8f5f9e
Merge pull request #44510 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-11-14 17:21:13 -05:00
Mircea Ulinic
777d01e82a
Add tests for the mandrill execution module 2017-11-14 11:26:56 +00:00
Mircea Ulinic
ba4a62769c
Fix trailing spaces 2017-11-14 09:21:55 +00:00
Mike Place
3af0031e02
Merge pull request #43504 from isbm/isbm-ansible-module-dev
Got Ansible own modules? Run them from within the Salt just like that!
2017-11-13 12:28:25 -07:00
rallytime
4e2280157a
Merge branch '2017.7' into 'develop'
Conflicts:
  - .kitchen.yml
  - tests/unit/test_doc.py
  - tests/unit/utils/test_cloud.py
2017-11-13 12:27:59 -05:00
Anthony Shaw
ba0280e727
linting updates 2017-11-11 15:25:36 +02:00
Anthony Shaw
78b90f3d0c
add remaining tests 2017-11-11 15:21:24 +02:00
Anthony Shaw
386c4e5791
add tests for all the getters 2017-11-11 14:55:25 +02:00
Bo Maryniuk
f8c016cd48 Remove extra assertions 2017-11-10 20:02:04 +01:00
Bo Maryniuk
755bc35585 Fix value is not iterable error 2017-11-10 20:02:04 +01:00
Bo Maryniuk
56c52e6ab3 Fix TypeError for argument of type 'LoaderError' is not iterable 2017-11-10 20:02:04 +01:00
Bo Maryniuk
8f7ef4f45f Lintfix: E9502 2017-11-10 20:02:04 +01:00
Bo Maryniuk
0594517a2e Lintfix: E0102 2017-11-10 20:02:04 +01:00
Bo Maryniuk
7742037bcd Don't bother with non-pytest unit tests 2017-11-10 20:02:04 +01:00
Bo Maryniuk
67cede713f Add unit test for module loader failure 2017-11-10 20:02:04 +01:00
Bo Maryniuk
4004e2f53d Add unit test for module loader 2017-11-10 20:02:04 +01:00
Bo Maryniuk
fd2fca0482 Improve module loader failure 2017-11-10 20:02:04 +01:00
Bo Maryniuk
25990f66bc Add unit test resolver module loader failure 2017-11-10 20:02:04 +01:00
Bo Maryniuk
9d0762a8ee Refactor to setup/teardown methods 2017-11-10 20:02:04 +01:00
Bo Maryniuk
630b654544 Add unit test for modules filtering 2017-11-10 20:02:04 +01:00
Bo Maryniuk
fc24371704 Do not use mock but real resolver class 2017-11-10 20:02:04 +01:00
Bo Maryniuk
082d47f2c1 Add unit test for documentation extractor 2017-11-10 20:02:04 +01:00
Bo Maryniuk
c7a1b733ab Add scaffold for the unit test 2017-11-10 20:02:04 +01:00
Bo Maryniuk
b2ed7d0ecd Mute pylint on misdetected regex-like strings that are actually just test data. 2017-11-10 19:50:47 +01:00
Bo Maryniuk
40f1e1d954 Rewrite unit tests for file.line on delete/replace an empty line 2017-11-10 19:50:47 +01:00
Bo Maryniuk
c2d9d8f8ea Add unit test for file.line ensuring line between two lines but content already exists 2017-11-10 19:50:47 +01:00
Bo Maryniuk
9963895719 Add unit test for file.line ensuring line inside the range of lines 2017-11-10 19:50:47 +01:00
Bo Maryniuk
1e1f5e5a6f Add unit test for file.line ensuring line between two other lines nearby 2017-11-10 19:50:47 +01:00
Bo Maryniuk
59de17b260 Add unit test for file.line on calling insert/ensure after specific line 2017-11-10 19:50:47 +01:00
Bo Maryniuk
710481b25e Add unit test for file.line when calling insert/ensure mode 2017-11-10 19:50:47 +01:00
Bo Maryniuk
b42b762c57 Add unit test for file.line when inserting a line at the end of the file (append functionality) 2017-11-10 19:50:46 +01:00
Bo Maryniuk
80c40bbb11 Remove irrelevant issue number 2017-11-10 19:50:46 +01:00
Bo Maryniuk
c95b3e031c Add unit test about file.line for insert/start 2017-11-10 19:50:46 +01:00
Bo Maryniuk
926372574d Remove irrelevant issue number from the docstring 2017-11-10 19:50:46 +01:00
Bo Maryniuk
b4cd4bd165 Add unit test for file.line replacement 2017-11-10 19:50:46 +01:00
Bo Maryniuk
9a72761dc6 Add unit test for file.line delete by direct match or regular expression 2017-11-10 19:50:46 +01:00
Bo Maryniuk
60185f578e Add unit test for file.line usage together with before/after 2017-11-10 19:50:46 +01:00
Bo Maryniuk
fc79a546dd Rename unit test 2017-11-10 19:50:46 +01:00
Bo Maryniuk
d1a41dd7bd Add unit test file.line insert before line 2017-11-10 19:50:46 +01:00
Bo Maryniuk
1ea7e33605 Harden unit test for 'after pattern' scenario 2017-11-10 19:50:46 +01:00
Bo Maryniuk
bde3611f08 Remove unnecessary code 2017-11-10 19:50:46 +01:00
Bo Maryniuk
fdffbe47b0 Add unit test for using patterns for line matching 2017-11-10 19:50:46 +01:00
Bo Maryniuk
ed171176a8 Rename unit test while using no patterns 2017-11-10 19:50:46 +01:00
Bo Maryniuk
d08307f53b Add unit test for file.line insert=after 2017-11-10 19:50:46 +01:00
Bo Maryniuk
39126da5a2 Update unit test data 2017-11-10 19:50:46 +01:00
Bo Maryniuk
47fbe03c14 Add unit test for file._starts_till function 2017-11-10 19:50:46 +01:00
Bo Maryniuk
599310e684 Fix docs for skipif decorator 2017-11-10 19:50:46 +01:00
Bo Maryniuk
d5d653af45 Add unit test for file.line on no location/before/after check failure 2017-11-10 19:50:46 +01:00
Bo Maryniuk
5b76c41f44 Move all file.line unit tests to the own class 2017-11-10 19:50:46 +01:00
Bo Maryniuk
f0f08a10e8 Add unit test for file.line on an empty content while not deleting anything 2017-11-10 19:50:46 +01:00
Bo Maryniuk
b5a80231bd Rename a unit test and clarify its purpose in docs 2017-11-10 19:50:46 +01:00
Bo Maryniuk
cf191b01d6 Add unit test for file.line on mode checks 2017-11-10 19:50:46 +01:00
Mike Place
8b834e341d
Merge pull request #44288 from eradman/onlyif_unless
Report 'onlyif' and 'unless' conditions as true or false
2017-11-10 11:37:01 -07:00
twangboy
6c872e95e6
Add back the setup_loader_modules function
Use empty dict instead of defining wmi
2017-11-10 11:30:00 -07:00
Erik Johnson
20273e3697
No need for setup_loader_modules since we're actually importing wmi 2017-11-10 11:29:59 -07:00
twangboy
8c107873cd
Remove wmi monkeypatching
The WMI object was being monkey patched in the global namespace causing
other tests to fail
2017-11-10 11:29:54 -07:00
rallytime
9fcc2a70b5
Merge branch '2016.11' into '2017.7'
Conflicts:
  - tests/unit/modules/test_rh_ip.py
2017-11-10 10:33:25 -05:00
Nicole Thomas
8ffe91fe44
Merge pull request #44405 from SEJeff/kubernetes-updates-v2
Kubernetes updates v2
2017-11-07 12:17:43 -07:00
Nicole Thomas
c03e997144
Merge pull request #44246 from nicholasmhughes/add-location-to-file.line-ensure
Add location support to file.line ensure
2017-11-06 22:35:18 -07:00
Sean Jenkins
ed8cccf457
#39901: Fix pylint 2017-11-06 17:02:53 -07:00
Sean Jenkins
43c81dfdee
#39901: Add unit tests 2017-11-06 15:04:22 -07:00
Anthony Shaw
c63222358b
update tests with correct assertions and mock methods on device instance 2017-11-06 05:01:31 +02:00
Anthony Shaw
b69c559c52
fix kwargs typo
setup basic unit test class

update wrapper
2017-11-06 04:39:30 +02:00
Jeff Schroeder
2b02a46544
Add the beginning of tests for states.kubernetes and update things
* Add 100% test coverage for the kubernetes.secret_present state
* Add 100% test coverage for the kubernetes.configmap_absent state
* Add 100% test coverage for the kubernetes.configmap_present state
* Make some fields optional to kubernetes.create_secret and add examples
* Make some fields optional to kubernetes.replace_secret and add examples
* Make some fields optional to kubernetes.create_configmap and add examples
* Make some fields optional to kubernetes.replace_configmap and add examples
* Add 'comment' when a kubernetes configmap or secret is going to be replaced
* Update 'source', 'template', and 'saltenv' kwargs to defaults from the rest of the codebase
* Allow passing empty 'data' to the kubernetes.configmap_present state to remove the existing contents
2017-11-05 13:34:37 -06:00
Mike Place
57705b9e6a
Merge pull request #44231 from SEJeff/kubernetes-stuff
Kubernetes module updates round one
2017-10-31 11:21:28 -06:00
Jeff Schroeder
1576c9980c
Fix test_kubernetes.py after fixing bug in 25f7c4996730a578b7875e924508a5c1774e8b7c 2017-10-26 18:20:49 -05:00
Jeff Schroeder
9304a428e3
Add the change-cause annotation to kubernetes created objects
This allows commands such as `kubectl rollout history deploy/$FOO` to
automatically show the deployment changed as a result of the salt run
and follows exactly how kubectl works when passed the `--record` flag.
2017-10-26 18:20:41 -05:00
Jeff Schroeder
9ceabf29f4
Fix kubernetes.node_labels()
This prevented showing, adding, or removing any labels from nodes
2017-10-26 18:20:34 -05:00
Jeff Schroeder
ac20ddfa25
Fix a bug in the kubernetes module for ssl cert paths
When the `client_key_file` attribute was defined and the `client_key`
attribute was not, the conditional for `client_key` would wrongly zero
`kubernetes.client.configuration.key_file`.

This was a bit annoying to figure out, but the kubernetes module now can
authenticate with minikube with a configuration such as this (where jeff
is $USER):

	kubernetes.api_url: 'https://192.168.99.100:8443'
	kubernetes.certificate-authority-file: '/home/jeff/.minikube/ca.crt'
	kubernetes.client-certificate-file: '/home/jeff/.minikube/client.crt'
	kubernetes.client-key-file: '/home/jeff/.minikube/client.key'

The various options can be gotten from ~/.kube/config after running `minikube start`.
2017-10-26 18:20:28 -05:00
Eric Radman
d921e1e6cb
Report 'onlyif' and 'unless' conditions as true or false
Elide terminology "execution failed/succeeded" since the result of these
conditions does not indicate a failure in state execution. Instead
simply report the result of each condition.
2017-10-25 11:03:13 -04:00
rallytime
28343f0120
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/git.py
2017-10-25 09:54:37 -04:00
twangboy
609361bf48
Fix some lint errors 2017-10-24 09:27:39 -06:00
twangboy
7a3ff9387d
Mock the rest of the tests 2017-10-24 09:27:38 -06:00
Erik Johnson
5ce14df82c
Change how members are retrieved in win_groupadd
This is a solution that works for the other functions that interact with
group objects, making it a better overall solution to be used widely
in win_groupadd.

This also updates the mocking in the tests such that we use a more
comprehensive fake class, and more intelligent mocking of get_sam_name
using a lambda.
2017-10-24 09:27:38 -06:00
twangboy
6ab82394be
Set up mocking
Move the code that sets up the group object, computer object and gets
existing members out of the individual functions so they can be mocked

Mock the GroupObj
Mock the ComputerObj
Mock existing members
Still need to fix info, getent, and members
2017-10-24 09:27:37 -06:00
nicholasmhughes
fa1c442943
added support for location in file.line when using ensure 2017-10-23 10:40:35 -04:00
Nicole Thomas
2ccfaca66c Merge pull request #44067 from eradman/check_file_meta
Check file attributes if lsattr(1) is installed
2017-10-23 10:30:58 -04:00
Eric Radman
6da4fd979b
Check file attributes in check_file_meta() if lsattr(1) is installed
lsattr/chattr is not installed on many Unix-like platforms by default,
including *BSD, Solaris, and minimal Linux distributions such as Alpine.
2017-10-19 18:38:12 -04:00
Mike Place
1e3abfea59 Merge branch 'develop' into various_beacon_fixes 2017-10-19 15:58:01 -05:00
Benedikt Werner
4bfeb7f1d1
Fixed missing import 2017-10-19 03:17:16 +02:00
Benedikt Werner
77b948b00a
Skip shadow module unit test if not root or no shadow 2017-10-18 19:10:55 +02:00
Marc Koderer
c4d9684a90 Use correct mac prefix for kvm/qemu
Using the private mac range for vms makes it impossible to
distinguish between hypervisors.

Issues #44056

Signed-off-by: Marc Koderer <marc.koderer@sap.com>
2017-10-17 10:46:06 +02:00
Gareth J. Greenaway
a89c26c88e
Various fixes to beacons to handle situations when beacons are stored in pillar. Updating execution module to report that beacons stored in pillar can not be managed via module. Updating add function to ensure beacon is available before attempting to add it. Updaitng unit tests to include new beacon is available check. 2017-10-16 14:32:12 -07:00
rallytime
c0f16dae74
Merge branch '2017.7' into 'develop'
Conflicts:
  - doc/topics/tutorials/index.rst
  - salt/crypt.py
  - salt/modules/cmdmod.py
  - salt/modules/grains.py
  - salt/pillar/git_pillar.py
  - salt/roster/clustershell.py
  - tests/unit/states/test_augeas.py
  - tests/unit/utils/test_utils.py
2017-10-16 15:26:19 -04:00
Erik Johnson
877abb89d0
Complete the salt.utils refactor
This moves the remaining 30 functions from salt.utils to new locations.
2017-10-15 09:43:31 -05:00
Erik Johnson
c6b655b6e9
Move 14 more functions from salt.utils
These functions are:

salt.utils.test_mode -> salt.utils.args.test_mode
salt.utils.split_input -> salt.utils.args.split_input
alt.utils.pem_finger -> salt.utils.crypt.pem_finger
salt.utils.is_bin_file -> salt.utils.files.is_binary
salt.utils.list_files -> salt.utils.files.list_files
salt.utils.safe_walk -> salt.utils.files.safe_walk
salt.utils.st_mode_to_octal -> salt.utils.files.st_mode_to_octal
salt.utils.normalize_mode -> salt.utils.files.normalize_mode
salt.utils.human_size_to_bytes -> salt.utils.files.human_size_to_bytes
salt.utils.get_hash -> salt.utils.hashutils.get_hash
salt.utils.is_list -> salt.utils.data.is_list
salt.utils.is_iter -> salt.utils.data.is_iter
salt.utils.isorted -> salt.utils.data.sorted_ignorecase
salt.utils.is_true -> salt.utils.data.is_true
2017-10-13 09:29:03 -05:00
Daniel Wallace
1f8ec5d335 Merge branch 'develop' into vagrant-module 2017-10-06 11:32:31 -06:00
Nicole Thomas
d136650b31 Merge pull request #43938 from terminalmage/salt.utils.user
Move several functions from salt.utils to salt.utils.user
2017-10-06 09:42:42 -04:00
Erik Johnson
aa3309ef59
Move several functions from salt.utils to salt.utils.user
These functions are as follows:

- salt.utils.get_user
- salt.utils.get_uid
- salt.utils.get_specific_user
- salt.utils.chugid
- salt.utils.chugid_and_umask
- salt.utils.get_default_group
- salt.utils.get_group_list
- salt.utils.get_group_dict
- salt.utils.get_gid_list
- salt.utils.get_gid
2017-10-05 19:50:14 -05:00
Nicole Thomas
7785919437 Merge pull request #43829 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-10-05 16:09:23 -04:00
garethgreenaway
37d7f13926 Merge branch 'develop' into vagrant-module 2017-10-05 10:25:24 -07:00
rallytime
eaca3291e2
Merge branch '2016.11' into '2017.7'
Conflicts:
  - tests/unit/modules/test_state.py
2017-10-05 12:09:40 -04:00
Nicole Thomas
a9dc04fb7f Lint: disable the unused-import check 2017-10-05 08:51:16 -04:00
Eric Radman
0dc3c4ef1c
Skip some vsphere tests if pyvmomi library is not installed
Also fix up 'E127: continuation line over-indented' lint errors
2017-10-04 13:09:29 -04:00
Vernon Cole
73947e3103
lint (again!) blank lines can have no spaces 2017-10-04 09:10:47 -06:00
Vernon Cole
67a701de7c lint PEP-8 2017-10-03 23:23:17 -06:00
Vernon Cole
83a3678cef
provide mocked unit tests 2017-10-03 17:24:05 -06:00
Vernon Cole
7d5a121265
Skip unit tests under Python3 until loader is fixed 2017-10-03 10:22:18 -06:00
rallytime
b7dae5addd
Bump with statements in one level
This is needed because the previous commit changed the context
management style from nested with statements to stacked with
statements.
2017-10-03 12:18:27 -04:00
Vernon Cole
c6b2e1e35b
update tests to match improved module
(cherry picked from commit 7fcdc51)
2017-10-02 22:10:37 -06:00
rallytime
c976df7c09
Fix mocking in test_status since the "which" util has moved 2017-09-29 13:56:01 -04:00
Alexandru Bleotu
b4a05dc7c0 Added tests for salt.modules.vsphere.remove_capacity_from_diskgroup 2017-09-29 13:39:44 -04:00
Alexandru Bleotu
ec2637db44 Added tests for salt.modules.vsphere.remove_diskgroup 2017-09-29 13:39:41 -04:00
Alexandru Bleotu
4e0755de20 Added tests for salt.modules.vsphere.remove_datastore 2017-09-29 13:39:39 -04:00
Alexandru Bleotu
51703a8a34 Added tests for salt.modules.vsphere.erase_disk_partitions 2017-09-29 13:39:36 -04:00
rallytime
a38ceab7cf
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cli/batch.py
  - salt/master.py
  - salt/utils/path.py
  - tests/unit/modules/test_state.py
2017-09-29 11:48:33 -04:00
Mike Place
952b5d8e87 Merge branch 'develop' into vagrant-module 2017-09-29 12:34:41 +02:00
Vernon Cole
e9661aea07
lint: must not use bare except: even in teardown 2017-09-28 18:27:54 -06:00
vernoncole
8d27e20b63 replace salt.utils.sdb calls with __utils__ 2017-09-28 16:43:47 -06:00
Mike Place
6f687fdcff Merge pull request #43779 from twangboy/win_fix_test_state
Fix `unit.modules.test_state` for Windows
2017-09-28 16:27:02 +02:00
Mike Place
db0f569f7a Merge pull request #43782 from twangboy/win_fix_test_virt
Fix `unit.modules.test_virt` for Windows
2017-09-28 16:25:15 +02:00
Mike Place
5e29507c21 Merge pull request #43781 from twangboy/win_fix_test_status
Fix `unit.modules.test_status` for Windows
2017-09-28 11:06:18 +02:00
Mike Place
05c78ae649 Merge pull request #43785 from twangboy/win_fix_test_znc
Fix `unit.modules.test_znc` for Windows
2017-09-28 10:56:10 +02:00
vernoncole
d59cc13ca4 try to pass unit tests on jenkins 2017-09-28 00:59:20 -06:00
garethgreenaway
1c05e37a66 Merge branch '2017.7' into win_fix_test_zypper 2017-09-27 20:15:18 -07:00
garethgreenaway
7d90721f6b Merge branch '2017.7' into win_fix_test_znc 2017-09-27 20:14:53 -07:00
vernoncole
cfda0d54e2 test inside sandbox, fix two lines of docs 2017-09-27 17:07:29 -06:00
twangboy
aafec7ab0e
Fix unit.modules.test_zypper for Windows
Use `os.linesep` for newline in expected return
2017-09-27 16:59:36 -06:00
twangboy
228e74c8e3
Fix unit.modules.test_znc for Windows
Mock the signal object as it's missing SIGUSR1 and SIGHUP on Windows
2017-09-27 16:54:06 -06:00
twangboy
058e50e530
Fix unit.modules.test_win_service
Mock `cmd.run`
2017-09-27 16:37:12 -06:00
twangboy
7192332758
Fix unit.modules.test_virt for Windows
Use os agnostic paths
Get system root from salt config
2017-09-27 16:12:05 -06:00
vernoncole
1f4451faaf lint and documentation cleanup for vagrant module 2017-09-27 14:59:47 -06:00
vernoncole
88d9e7ed83 replace cache storage with sdb 2017-09-27 14:59:47 -06:00
vernoncole
eb5cd38f85 remove unused keyword argument 'deploy' in tests too 2017-09-27 14:59:47 -06:00
vernoncole
879ae3b291 lint fix round 2 2017-09-27 14:59:47 -06:00
vernoncole
2e162280a9 replace subprocess calls with salt cmd.x calls 2017-09-27 14:59:47 -06:00
vernoncole
7fd1e29ce9 lint fixes 2017-09-27 14:59:47 -06:00
vernoncole
c8a78c7ceb provide unit tests 2017-09-27 14:59:47 -06:00
vernoncole
2524dd9bba skeleton unit test 2017-09-27 14:59:47 -06:00
twangboy
16ae8253c1
Mock which, use os.linesep for cmd.run return 2017-09-27 14:41:25 -06:00