Commit Graph

1497 Commits

Author SHA1 Message Date
twangboy
61f8a2f7ff
Skip mac specific tests 2017-09-26 14:36:11 -06:00
Mike Place
426eb92474 Merge branch 'develop' into raid_add 2017-09-21 15:37:31 -06:00
Vladimir Nadvornik
1c006db2a6 Fix and extend mdadm unit tests 2017-09-21 17:46:15 +02:00
Mike Place
99c6375d9a Merge branch 'develop' into ssh_known_hosts_improvements 2017-09-19 18:13:20 -06:00
Alexei Pope Lane
ad80801d0f Improvements to SSH known_hosts module and state. 2017-09-19 13:28:48 +10: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
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
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
da16b6670a Merge pull request #42752 from skizunov/develop4
Add config option to ensure jid is unique
2017-09-11 13:38:30 -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
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
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
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
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
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
Nicole Thomas
df18a89836 Lint: Remove unused import 2017-08-28 09:21:52 -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
Andy Bulford
89ac3f9092 Merge branch 'develop' into add-docker-network-ipam-support 2017-08-23 23:02:07 +01:00
Mike Place
ae5d3ffe99 Merge pull request #43013 from amendlik/kernelpkg-remove
Add kernelpkg functions to remove kernel packages
2017-08-23 11:47:58 -06:00
Andy Bulford
49f4f990c3 Merge branch 'develop' into add-docker-network-ipam-support 2017-08-22 09:44:21 +01:00
Mike Place
3940084df9 Merge branch 'develop' into postgres-valid-until 2017-08-21 16:16:18 -06:00
Mike Place
b071384611 Merge pull request #42977 from redmatter/fix-broken-docker-network-create
Remove check_duplicates from create_network call
2017-08-21 15:59:50 -06:00
Mike Place
a063ddbaad Merge branch 'develop' into kernelpkg-remove 2017-08-21 14:18:22 -06:00
rallytime
6ca3607770 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/engines/slack.py
  - salt/modules/win_pkg.py
  - salt/utils/versions.py
2017-08-18 09:28:26 -04:00
Andrew Bulford
d4507f1a08 Re-use container connection logic on net creation
Re-factoring a little following the previous commit, so that the same
container connection logic can be used in both places, rather than it
being repeated.
2017-08-18 13:36:46 +01:00
Andrew Bulford
d59d0adfeb Add ability to re-configure docker networks
Previously any changes to network states wouldn't result in any change
to the network when the state was applied.  This was less of an issue
the only attributes you could set for a network were its name and
driver, but with the recent support for driver options and now IPAM
config being added, it's useful for the state to be able to modify the
network if it needs to.

The Docker API doesn't provide any facility to modify an existing
network, so the only option is to recreate it with the new options,
which means disconnecting and reconnecting all containers.

Fixes #43047
2017-08-18 13:36:14 +01:00
Andrew Bulford
ec2a8a82c8 Add support for IPAM config in Docker networks
Fixes #43047
2017-08-18 13:35:48 +01:00
Andrew Bulford
8048fbcfa7 Remove check_duplicates from create_network call
The create_network function in dockermod.py doesn't take a
check_duplicates argument so passing it here causes a failure.

Fixes #42976
2017-08-18 13:26:33 +01:00
Adam Mendlik
f87fe54b7b Fix linter errors for kernelpkg modules and states 2017-08-17 11:27:57 -06:00
rallytime
8a0f948e4a Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/utils/versions.py
  - tests/unit/modules/test_boto_elb.py
  - tests/unit/modules/test_boto_secgroup.py
  - tests/unit/states/test_boto_vpc.py
2017-08-17 09:10:31 -04:00
Andrew Bulford
d3f792d47d Remove check_duplicates from create_network call
The create_network function in dockermod.py doesn't take a
check_duplicates argument so passing it here causes a failure.

Fixes #42976
2017-08-16 14:05:31 +01:00
Nicole Thomas
abac36d907 Merge pull request #42450 from pwdng/ldap_fix
Use OrderedSet instead of set to allow handling of OpenLDAP X-ORDERED…
2017-08-15 17:30:35 -04:00
Nicole Thomas
275122d04e Merge pull request #42834 from terminalmage/salt.utils.versions
Move 4 functions from salt.utils to salt.utils.versions
2017-08-15 17:28:24 -04:00
Mike Place
4f406602cf Merge branch 'develop' into ldap_fix 2017-08-15 12:36:47 -06:00
rallytime
5597b1a30e Skip 2 failing tests in Python 3 due to upstream bugs 2017-08-15 14:26:44 -04:00
rallytime
6ae1111295 Replace @mock_ec2 calls with @mock_ec2_deprecated calls
moto versions >= 1.0.0 have changed the way the mocked connections through
boto are handled with the @mock_ec2 decorator. They use the boto3 connection
method. However, since we are still using boto in many places, we need to use
the new @mock_ec2_deprecated decorator instead to handle the boto connection
functions for the unit tests.

Versions of moto < 1.0.0 are not Python 3 compatible, so salt-jenkins should
be installing newer versions of moto for those tests. Unfortunately, we cannot
install an older version of moto for Python2 that use the original @mock_ec2 call
and also import the @mock_ec2_deprecated function for newer versions of moto
simultaneously as the @mock_ec2_deprecated function doesn't exist in older
versions of moto.
2017-08-15 14:22:59 -04:00
Erik Johnson
2b76029ded Move 4 functions from salt.utils to salt.utils.versions
This moves the following functions from salt.utils to salt.utils.versions:

- warn_until
- kwargs_warn_until
- compare_versions (as salt.utils.versions.compare)
- version_cmp
2017-08-15 12:53:57 -05:00
garethgreenaway
8b48341a36 Merge branch 'develop' into fixing_beacons 2017-08-15 09:00:09 -07:00
Mike Place
db32d81d8a Merge pull request #42917 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-08-14 21:53:18 -06:00
Nicole Thomas
4fcdab3ae9 Merge pull request #42657 from nhavens/2017.7
back-port #42612 to 2017.7
2017-08-14 15:42:25 -04:00
garethgreenaway
bbaae409b5 Merge branch 'develop' into postgres-valid-until 2017-08-14 12:09:43 -07:00
Gareth J. Greenaway
71963cccce fixing more lint issues 2017-08-14 12:04:38 -07:00
Gareth J. Greenaway
23d572199a Adding test_beacon for the beacon state module. Updating beacon state module documentation. Removing over aggressive code in the validate function for service beacon. 2017-08-14 12:04:38 -07:00
rallytime
78e744bda4 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/client/mixins.py
  - salt/fileclient.py
  - salt/modules/status.py
  - tests/integration/states/test_npm.py
2017-08-14 14:21:17 -04:00
Adam Bolte
7848189ad4
Implement rbenv state module test mode checks
Fixes #42815 and updates unit tests.
2017-08-14 19:13:42 +10:00
Gilbert Gilb's
3c136e3138 Add support for PostgreSQL password expiration. 2017-08-12 13:48:12 +02:00
rallytime
43643227c6 Skip 2 failing tests in Python 3 due to upstream bugs 2017-08-11 12:57:39 -04:00
rallytime
3055e17ed5 Replace @mock_ec2 calls with @mock_ec2_deprecated calls
moto versions >= 1.0.0 have changed the way the mocked connections through
boto are handled with the @mock_ec2 decorator. They use the boto3 connection
method. However, since we are still using boto in many places, we need to use
the new @mock_ec2_deprecated decorator instead to handle the boto connection
functions for the unit tests.

Versions of moto < 1.0.0 are not Python 3 compatible, so salt-jenkins should
be installing newer versions of moto for those tests. Unfortunately, we cannot
install an older version of moto for Python2 that use the original @mock_ec2 call
and also import the @mock_ec2_deprecated function for newer versions of moto
simultaneously as the @mock_ec2_deprecated function doesn't exist in older
versions of moto.
2017-08-10 16:40:11 -04:00
Erik Johnson
3184168365 Use explicit unicode strings + break up salt.utils
This PR is part of what will be an ongoing effort to use explicit
unicode strings in Salt. Because Python 3 does not suport Python 2's raw
unicode string syntax (i.e. `ur'\d+'`), we must use
`salt.utils.locales.sdecode()` to ensure that the raw string is unicode.
However, because of how `salt/utils/__init__.py` has evolved into the
hulking monstrosity it is today, this means importing a large module in
places where it is not needed, which could negatively impact
performance. For this reason, this PR also breaks out some of the
functions from `salt/utils/__init__.py` into new/existing modules under
`salt/utils/`. The long term goal will be that the modules within this
directory do not depend on importing `salt.utils`.

A summary of the changes in this PR is as follows:

* Moves the following functions from `salt.utils` to new locations
  (including a deprecation warning if invoked from `salt.utils`):
  `to_bytes`, `to_str`, `to_unicode`, `str_to_num`, `is_quoted`,
  `dequote`, `is_hex`, `is_bin_str`, `rand_string`,
  `contains_whitespace`, `clean_kwargs`, `invalid_kwargs`, `which`,
  `which_bin`, `path_join`, `shlex_split`, `rand_str`, `is_windows`,
  `is_proxy`, `is_linux`, `is_darwin`, `is_sunos`, `is_smartos`,
  `is_smartos_globalzone`, `is_smartos_zone`, `is_freebsd`, `is_netbsd`,
  `is_openbsd`, `is_aix`
* Moves the functions already deprecated by @rallytime to the bottom of
  `salt/utils/__init__.py` for better organization, so we can keep the
  deprecated ones separate from the ones yet to be deprecated as we
  continue to break up `salt.utils`
* Updates `salt/*.py` and all files under `salt/client/` to use explicit
  unicode string literals.
* Gets rid of implicit imports of `salt.utils` (e.g. `from salt.utils
  import foo` becomes `import salt.utils.foo as foo`).
* Renames the `test.rand_str` function to `test.random_hash` to more
  accurately reflect what it does
* Modifies `salt.utils.stringutils.random()` (née `salt.utils.rand_string()`)
  such that it returns a string matching the passed size. Previously
  this function would get `size` bytes from `os.urandom()`,
  base64-encode it, and return the result, which would in most cases not
  be equal to the passed size.
2017-08-08 13:33:43 -05:00
rallytime
f20f3742cb Merge branch '2017.7' into 'develop'
Conflicts:
  - tests/unit/test_crypt.py
2017-08-07 10:43:06 -04:00
Mike Place
547ada9418 Merge pull request #42612 from nhavens/develop
fix for issue #42611
2017-08-03 17:37:05 -05:00
Mike Place
b8acf9f6ec Merge pull request #42624 from lyft/modernize-boto-sqs-modules
Modernize boto_sqs execution and state modules
2017-08-03 17:34:18 -05:00
Neile Havens
d73c4b55b7 back-port #42612 to 2017.7 2017-07-31 17:10:06 -05:00
Neile Havens
afce919746 Merge branch 'develop' into develop 2017-07-31 15:51:10 -05:00
Mike Place
5baf2650fc Merge pull request #42453 from gtmanfred/makedirs
don't pass user to makedirs on windows
2017-07-31 14:57:57 -05:00
Aneesh Agrawal
c4f5888c85 Modernize boto_sqs execution and state modules
Headline changes:
- Move to boto3
- Use result-style error handling
- Optimize number of API calls:
  - Set attributes at creation time
  - Set all attributes in one API call
- Show diff when attribute changes detected
2017-07-31 18:08:29 +00:00
Philippe Wooding
78f5da36f4
Update LDAP unit test 2017-07-31 14:28:27 +02:00
Nicole Thomas
7d385f8bdc Merge pull request #42006 from redmatter/fix-dockerng-network-matching-2017.7
Fix dockerng.network_* name matching
2017-07-28 09:52:51 -06:00
Nicole Thomas
f83960c02a Lint: Remove extra line at end of file. 2017-07-28 09:13:59 -06:00
Neile Havens
8eee58af97 fix test_selinux for issue #42611
- expect change from selinux.boolean state if it makes changes
- result = False if there's an error making changes
2017-07-28 09:39:38 -05:00
Andrew Bulford
c7d364ec56 Add regression tests for #41982
These test the scenarios where another network with a similar name
already exists, verifying that absent doesn't attempt to remove a
network which isn't specified, and present still attempts to create the
specified network despite a similarly named network already being present.
2017-07-28 10:41:44 +01:00
Andrew Bulford
d31f2913bd Fix broken unit test test_network_absent
This started failing following commit 515c612, which relied on the
'Name' key being present in the return value of docker.networks -
as the mock didn't have this set the test started failing.
2017-07-28 09:57:45 +01:00
garethgreenaway
bab7503f68 Merge branch 'develop' into linux_acl_fixes-gh 2017-07-27 16:59:36 -07:00
Nicole Thomas
22eea389fa Merge pull request #42290 from isbm/isbm-module_run_parambug_42270_217
Backport of #42270
2017-07-27 16:30:05 -06:00
Daniel Wallace
559d432930 fix tests 2017-07-27 12:00:38 -06:00
rallytime
1f0b90aa57 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cloud/clouds/joyent.py
  - salt/engines/slack.py
2017-07-26 17:51:36 -06:00
Mike Place
07c2793e86 Merge pull request #42266 from twangboy/win_unit_states_test_file
Fix `unit.states.test_file` for Windows
2017-07-25 15:26:32 -05:00
Alexandru Bleotu
8e415c8ef7 Updated and added linux_acl_test.present tests 2017-07-24 19:35:06 +01:00
Alexandru Bleotu
d5b6c6be25 Fixed pylint 2017-07-20 21:06:35 +01:00
Alexandru Bleotu
5a63ed7449 Added tests for datacenter_configured state 2017-07-20 16:43:44 +01:00
Erik Johnson
2fb986f5ca Merge pull request #42367 from rallytime/files-util
Move file-related utilities out of init file and into salt.utils.files.py
2017-07-19 16:55:52 -05:00
rallytime
0ab4787d81 Fix all salt.utils fopen references in test_file 2017-07-18 17:10:11 -06:00
rallytime
3f0945b9b7 Fix one more salt.utils fopen reference to point to files 2017-07-18 15:04:49 -06:00
rallytime
89d957b124 Update unit test mocks for salt.utils.files.fopen 2017-07-18 13:40:07 -06:00
rallytime
ccf790a83f Update all references for moved functions to use "files" util
- fopen
- flopen
- fpopen
- safe_rm
- is_empty
- is_fcntl_available
2017-07-18 10:31:01 -06:00
rallytime
f59ecb7ffe Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/executors/sudo.py
2017-07-18 08:57:55 -06:00
Mike Place
36395625c2 Merge pull request #42258 from twangboy/win_unit_states_tests_environ
Fix `unit.states.test_environ` for Windows
2017-07-17 12:50:37 -05:00
Bo Maryniuk
8c71257a4b Call unnamed parameters properly 2017-07-13 10:11:00 +02:00
Bo Maryniuk
94c97a8f25 Update and correct the error message 2017-07-13 10:10:50 +02:00
twangboy
ed89cd0b93 Use os.sep for path seps 2017-07-12 10:13:26 -06:00
twangboy
669aaee10d Mock file exists properly 2017-07-11 17:09:21 -06:00
twangboy
a4231c9827 Fix ret mock for linux 2017-07-11 16:59:42 -06:00
twangboy
0c484f8979 Fix unit tests on Windows 2017-07-11 16:55:43 -06:00
twangboy
55b278c478 Mock the reg.read_value function 2017-07-11 13:23:11 -06:00
rallytime
bf45c18f9d Convert remaining "assert_called_once" references to new syntax
These tests are new to develop and need to be converted to use the new
assert_called_once syntax introduced in #42084.
2017-07-07 10:28:19 -06:00
rallytime
cdfcc854ad [PY3] Make test_saltmod unit tests less flaky for Python 3
Separates out the comment from the rest of the state return to make this
test more stable on Python 3. This state run in PY3 adds the minion
names to the comment in a random order, so we can't rely on asserting
against this order in the test.

This PR updates the test so that we are still checking for all of the
elements in the comment, but not relying on the order the minions are
added the comment list.
2017-07-05 12:56:03 -06:00
Andrew Bulford
9eea796da8 Add regression tests for #41982
These test the scenarios where another network with a similar name
already exists, verifying that network_absent doesn't attempt to remove
a network which isn't specified, and network_present still attempts to
create the specified network despite a similarly named network already
being present.
2017-06-30 11:03:45 +01:00
Andrew Bulford
3369f0072f Fix broken unit test test_network_absent
This started failing following commit 515c612, which relied on the
'Name' key being present in the return value of dockerng.networks -
as the mock didn't have this set the test started failing.
2017-06-30 11:01:10 +01:00
rallytime
e512a29f08 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/state.py
  - salt/modules/yumpkg.py
  - salt/modules/zypper.py
  - salt/states/pkg.py
  - salt/version.py
  - tests/unit/config/test_config.py
  - tests/unit/modules/test_zypper.py
2017-06-28 11:31:53 -06:00
twangboy
b2c13654ac Fix unit tests 2017-06-23 15:57:47 -06:00
Pablo Suárez Hernández
686c45b8ab Fix buggy test 2017-06-21 09:32:01 +01:00
Michael Calmer
24bad5b078 translate variable arguments if they contain hidden keywords (bsc#1025896)
- includes a test
2017-06-20 17:28:39 +01:00
Mike Place
ffb8149de4 Merge pull request #41777 from garethgreenaway/41742_adding_force_option
Additions to lvm module and state module
2017-06-19 11:56:44 -05:00
rallytime
58262608cd Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/config/__init__.py
  - salt/master.py
  - salt/modules/zypper.py
  - tests/unit/modules/timezone_test.py
2017-06-16 10:43:02 -06:00
garethgreenaway
899d852791 Merge branch 'develop' into 41742_adding_force_option 2017-06-15 16:07:06 -07:00
garethgreenaway
d41c4ab45b Merge branch 'develop' into 41667_adding_additional_options 2017-06-15 15:54:30 -07:00
Gareth J. Greenaway
87ff0eb3ad Adding the force option for situation where the -yes argument needs to be passed along to lvcreate 2017-06-15 13:39:17 -07:00
rallytime
7fef4cf38f Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/engines/slack.py
2017-06-15 10:57:27 -06:00
Sébastien Wains
fae41c2875 Adjusting SVN unit test 2017-06-14 13:40:50 -06:00
rallytime
b0145578bf Update Nitrogen references to 2017.7.0 for states, utils, tests directory
Also updated version.py with release tuple
2017-06-14 11:54:27 -06:00
Gareth J. Greenaway
78052ff00e Updating the unit test for libvirt to include coverage for new options 2017-06-14 10:40:06 -07:00
Nicole Thomas
03af4b4e4a Merge branch 'develop' into svn-bug-41022 2017-06-12 14:34:36 -06:00
Art Schneider
1b568a7c7a Fixed cron tests 2017-06-08 16:15:49 -06:00
Sébastien Wains
ffdaba0955 Adjusting SVN unit test 2017-06-08 22:10:52 +02:00
rallytime
2cb4f2baa9 Merge branch 'nitrogen' into 'develop'
Conflicts:
  - salt/states/keystone.py
2017-06-06 12:50:35 -06:00
rallytime
903e2f9922 Merge branch '2016.11' into 'nitrogen'
No conflicts.
2017-06-05 13:38:51 -06:00
rallytime
833b2145c4 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-06-01 17:15:36 -06:00
rallytime
cb69296f55 Remove test_win_firewall unit tests: they don't actually test anything 2017-06-01 10:07:23 -06:00
Sean Jenkins
095e5949a3 Fix unit tests for PR #41509 2017-05-31 17:22:07 -06:00
rallytime
675937e0ab Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - tests/unit/states/test_keystone.py
2017-05-30 10:16:14 -06:00
Evan Davis
c2235d23c9 Fix test_absent unit test. 2017-05-26 16:11:17 -07:00
Evan Davis
a186af3bb4 Fix postgres_schema unit tests. 2017-05-26 12:45:51 -07:00
rallytime
9b84b751b2 Pylint fixes 2017-05-26 12:38:38 -06:00
Petr Michalec
6db8915021 Endpoint handling per region, fixes #35874
- extend tests for multiple regions
- region arg by default set to None
- print verbose changes to be exec.
2017-05-26 11:15:29 -06:00
Mike Place
4678b5cb84 Merge pull request #41386 from grahamhayes/unit-tests-40905
Add unit test for PR #40905
2017-05-24 12:02:13 -05:00
Benjamin Drung
33a7f8b2ec Fix typos
lintian found several spelling errors.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2017-05-24 12:50:29 +02:00
Tom Williams
3eebfb7e73 INFRA-4842 - /thought/ I fixed this :) 2017-05-23 12:04:19 -04:00
Graham Hayes
44b7ecf45f
Add unit test for PR #40905
This ensures we do not introduce a regression which breaks
the usage of the `batch` option when using states in orchestration
runners.

Related to #40635 and #39169
2017-05-23 16:23:17 +01:00
Tom Williams
7d519a4533 INFRA-4842 - fixup unit tests to suit 2017-05-22 23:26:03 -04:00
Tom Williams
dcadf12d4d INFRA-4842 - update unit test to account for new test=True result 2017-05-18 18:04:01 -04:00
Winston Liu
a96e431717 fixed unit test failures. 2017-05-16 15:09:00 -07:00
Anthony Shaw
2f610680e5 remove unused imports 2017-05-12 16:38:30 -06:00
Anthony Shaw
9b7de2e7d7 fix unit tests 2017-05-12 16:37:26 -06:00
Anthony Shaw
49d94559ab linting 2017-05-12 16:36:07 -06:00
Anthony Shaw
4b260a4594 linting 2017-05-12 16:36:07 -06:00
Anthony Shaw
41d1adab5f fix up tests 2017-05-12 16:36:06 -06:00
rallytime
4100e2b6a6 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-05-10 15:32:33 -06:00
rallytime
12a75c1108 Merge branch '2016.11' into 'nitrogen'
No conflicts.
2017-05-10 15:32:23 -06:00
Nicole Thomas
496fa3accd Merge pull request #41156 from rallytime/merge-nitrogen
[nitrogen] Merge forward from 2016.11 to nitrogen
2017-05-10 15:29:54 -06:00
lomeroe
2af89f2165 update mock data 2017-05-10 10:33:34 -05:00
lomeroe
b7fa115a59 update win_dns_client tests with correct module names 2017-05-10 10:33:33 -05:00
twangboy
bc827ad8a7 Fix unit test 2017-05-09 16:00:24 -06:00
rallytime
ef0df4a954 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/modules/win_network.py
  - salt/modules/win_pkg.py
  - salt/utils/gitfs.py
  - tests/unit/modules/test_win_network.py
  - tests/unit/states/test_file.py
2017-05-09 14:32:49 -06:00
Mike Place
8099c9f27f Merge pull request #41081 from lomeroe/fix-win_dns_client-reg_read
Update win_dns_client to use reg.read_value and set_value
2017-05-09 12:13:51 -06:00
lomeroe
3375fc0244 update mock data 2017-05-08 12:05:56 -05:00
Theophile Meneau
d8766562c9 fix incorrect service.running success response
when enable=None and init script returns 0,
but service failed to start.

Fixes #41125
2017-05-08 10:25:21 -04:00
Erik Johnson
ffe4bc3d5c update unit test to reflect new behavior 2017-05-06 01:29:49 -05:00
lomeroe
2b1290b9e3 update win_dns_client tests with correct module names 2017-05-05 12:09:17 -05:00
Mike Place
330e717150 Merge pull request #40977 from amendlik/kernelpkg
kernelpkg module
2017-05-05 10:21:12 -06:00
Adam Mendlik
2bc930acb3 Fix linter errors 2017-05-05 06:27:37 -06:00
Adam Mendlik
741fd9d1ee Rename kernelpkg.current to kernelpkg.active for clarity 2017-05-04 19:15:04 -06:00
Adam Mendlik
fd09ae7f1a Add state modules to manage Linux kernel packages 2017-04-30 12:53:57 -06:00
Anthony Shaw
bb62c73b1b
clean up dns test method 2017-04-29 10:48:04 +10:00
Anthony Shaw
1c808dbbc0
inherit from dicts for test classes 2017-04-29 09:55:27 +10:00
Anthony Shaw
d9ee7b3b7f Fix class rename errors. 2017-04-29 08:28:28 +10:00
Anthony Shaw
e92a7ba660 Merge branch 'develop' into libcloud_state 2017-04-29 07:43:28 +10:00
rallytime
f875ee3309 Merge branch 'nitrogen' into 'develop'
Conflicts:
  - tests/integration/runners/test_runner_returns.py
2017-04-28 09:26:26 -06:00
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
Pedro Algarvio
ef3dbb10de
Lint fixes 2017-04-28 13:33:35 +01:00
Pedro Algarvio
3bf84e2a4e
Rename classes in order not to be collected up by pytest 2017-04-28 13:33:34 +01:00
Anthony Shaw
df93290f24
update DNS states to support dictionary responses 2017-04-26 13:34:52 +10:00
rallytime
ce13658301 Lint fixes for keystone state and keystone state unit tests 2017-04-24 09:27:52 -06:00
Mike Place
6da806d1cc Merge pull request #39850 from epcim/pr_fix_keystone_endpoints_multiregion
Fix endpoint handling per region
2017-04-23 04:00:00 -06:00
Petr Michalec
ab1dd446e7
Endpoint handling per region, fixes #35874
- extend tests for multiple regions
- region arg by default set to None
- print verbose changes to be exec.
2017-04-21 15:48:52 +02:00
Andrey Arapov
4c29c5f6ab
dockerng: avoid network duplication and add driver_opts 2017-04-21 08:52:55 +02:00
rallytime
885419b3e7 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-04-17 13:27:58 -06:00
rallytime
9905eb7273 Merge branch 'nitrogen' into 'develop'
Conflicts:
  - salt/netapi/__init__.py
2017-04-14 10:50:31 -06:00
rallytime
f552dd63f3 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - pkg/windows/installer/Salt-Minion-Setup.nsi
  - tests/unit/states/test_tomcat.py
2017-04-14 10:46:56 -06:00
rallytime
e440d2e8af Use self.setGrains as context manager in grains test 2017-04-13 13:39:11 -06:00
rallytime
3d6c983c69 Remove unused import for lint 2017-04-13 11:52:20 -06:00
Daniel Wallace
a61fc824c4 use loader for war extraction
Also set the version added in the docs
2017-04-13 11:51:22 -06:00
rallytime
17efc7341c Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/modules/win_wua.py
  - salt/netapi/rest_cherrypy/app.py
  - salt/version.py
  - tests/unit/states/grains_test.py
  - tests/unit/states/test_archive.py
2017-04-13 10:14:51 -06:00
Mike Place
92b5f03beb Merge pull request #40551 from terminalmage/issue39868
Fix four issues in archive.extracted state
2017-04-12 12:37:51 -06:00
Daniel Wallace
b0bd99c26d add comment and unit test 2017-04-11 21:08:06 -06:00
Chris Heald
5139275602 Add env support for rvm.installed and rvm.do, opts support for .installed
Currently, the RVM state has no way to pass environment variables (ie, RUBY_CONFIGURE_OPTS)
or compilation flags (-C, --patch) to the Ruby installer. This patch enables this
functionality, permitting installation of customized Ruby installs. For example, the following
should now work:

   ruby-2.3.0:
     rvm.installed:
       - env:
           - RUBY_CONFIGURE_OPTS: --with-jemalloc
       - opts:
           - '--patch /path/to/my.patch'
           - '-C --enable-shared,--with-readline-dir=$HOME/.rvm/usr'
2017-04-10 12:40:56 -07:00
Erik Johnson
5ea1f607b0 Fix mocking in unit tests 2017-04-10 13:57:39 -05:00
Mike Place
56363bc41c Merge pull request #40462 from cachedout/state_expect_minions
Fix orch state when no minions return
2017-04-06 11:58:14 -06:00
Mike Place
60750a1619
Fix test 2017-04-06 10:48:27 -06:00
Nicole Thomas
4d7871e4d7 Merge pull request #40494 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-04-05 14:15:05 -06:00
rallytime
71f3c73150 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/template.py
  - salt/utils/pycrypto.py
  - tests/integration/modules/test_state.py
  - tests/unit/states/test_artifactory.py
  - tests/unit/test_template.py
2017-04-05 13:02:14 -06:00
Nicole Thomas
59db716817 Merge pull request #40510 from twangboy/deprecate_win_update
Add deprecation warnings to win_update state and execution modules
2017-04-05 11:47:56 -06:00
twangboy
70b61dda39 Fix unit tests, spell Fluorine correctly 2017-04-04 23:42:36 -06:00
Pedro Algarvio
785698d2ce
Import for the original module 2017-04-04 18:04:38 +01:00
Pedro Algarvio
8031ac0209
Move mixins to tests.support.mixins.
The adapted config mixin get config methods are not static methods
2017-04-04 17:29:34 +01:00
Pedro Algarvio
f8d7530a58
Proper mocking. 2017-04-01 14:22:59 +01:00
Pedro Algarvio
9dbdee68ba
Move tests to the right test module 2017-04-01 14:22:54 +01:00
rallytime
8f084f7056 Update unit test to look for actual string comment 2017-03-31 15:34:24 -06:00
Lukas Raska
24cc9b2a0c [WIP] Refactor Elasticsearch execution and state modules (#40192)
* Add Ingest pipeline methods to Elasticsearch execution module

* Refactor Elasticsearch execution module and properly handle exceptions

* Throw CommandExecutionError in methods applicable for different Elasticsearch versions

* Refactor Elasticsearch states to reflect execution module changes

* Add state for managing Elasticsearch pipelines

* Fix few typos in Elasticsearch module, return None when deleted document doesn't exist

* Implements stats and health methods for Elasticsearch

* Add Elasticsearch methods to open/close index, manage search templates and repositories

* Merge existing Elasticsearch states into single one, add Search Template handling

* Add index alias state for Elasticsearch, fix documentation

* Catch all global exceptions in Elasticsearch states, unit test all of them

* Implement few Unit tests for Elasticsearch execution module, merge fixes into deprecated elastic states

* Implement additional unit tests for Elasticsearch execution module

* Finalize Elasticsearch module documentation
2017-03-30 13:22:58 -06:00
rallytime
52edbffc85 Merge branch '2016.11' into 'develop'
Conflicts:
  - doc/ref/cache/all/index.rst
  - doc/topics/cache/index.rst
  - salt/cache/localfs.py
  - salt/modules/boto_rds.py
  - salt/roster/cloud.py
  - salt/states/virtualenv_mod.py
  - tests/integration/states/test_archive.py
  - tests/unit/modules/test_dockermod.py
  - tests/unit/states/dockerng_test.py
2017-03-28 17:09:30 -06:00
Pedro Algarvio
e95b7e062c
Proper mocking. Fix tests expectations. Runs on non windows too. 2017-03-28 19:04:03 +01:00
Pedro Algarvio
2b8d26b811
The develop branch no longer targets python 2.6 2017-03-28 19:04:03 +01:00
Pedro Algarvio
845cbabe97
Code cleanup. Proper mocking. 2017-03-28 19:04:03 +01:00
Pedro Algarvio
99bc71dc4e
Proper mocking. 2017-03-28 19:04:01 +01:00
Pedro Algarvio
d397763553
Adjust to the new LoaderModuleMockMixin usage 2017-03-28 19:03:59 +01:00
Pedro Algarvio
e7768705f9
Allow passing different loader_module_globals per loader_module 2017-03-28 19:02:51 +01:00
Pedro Algarvio
9b1e55aa85
Import the full module namespace to avoid import shadowing.
https://github.com/saltstack/salt/pull/39996#issuecomment-287857698
2017-03-28 19:02:47 +01:00
Pedro Algarvio
5216ff0932
Code cleanup. Proper mocking 2017-03-28 19:00:52 +01:00
Pedro Algarvio
1f7a0aa65b
Proper mocking 2017-03-28 19:00:51 +01:00
Mike Place
d7e745a53a Merge pull request #40281 from terminalmage/rename-docker
Rename docker execution module to avoid shadowing in the loader
2017-03-28 11:06:08 -06:00
Mike Place
2d2cb5b837 Merge pull request #40333 from gtmanfred/2016.11
fix some test=True comments
2017-03-28 10:11:00 -06:00
Erik Johnson
774a3f1147 Rename docker execution module to avoid shadowing in the loader
With the merging of #39996, salt/modules/docker.py now imports
salt.utils.docker. However, our loader appends the module dir (in
this case salt/modules/) to sys.path temporarily for the length of the
loading process. So, as the docker execution module tries to import
salt.utils.docker, when salt.utils.docker attempts to do an "import
docker", and docker-py is *not* installed, this results in
salt/modules/docker.py (the docker execution module) being loaded in its
place, which results in tracebacks in the minion log.

Renaming the docker execution module keeps this import shadowing from
occurring. Note that we don't need to do this for the placeholder
salt/states/docker.py as it does not import salt.utils.docker.
2017-03-28 10:50:47 -05:00
Daniel Wallace
5596620dfb fix some test=True comments
Alternatives should say it is setting the symlink to `path` instead of
`current` which it is already set to

ssh_auth.absent should say it is going to remove the key, unless the status is
set to `add`, then it is already absent

Fixes #40322
Fixes #40321
2017-03-27 18:19:52 -05:00
Anthony Shaw
ee0daa1b64
remove unused imports 2017-03-25 11:44:55 +11:00
Anthony Shaw
10c84303db
fix unit tests 2017-03-24 15:13:03 +11:00
Anthony Shaw
605a12dbc0
linting 2017-03-24 14:05:19 +11:00
rallytime
a9c5eebaf0 Clean up dockerng unit tests to avoid global variables and fixup some patching 2017-03-23 12:44:57 -06:00
Anthony Shaw
1efd5a19fb
linting 2017-03-23 22:12:12 +11:00
Anthony Shaw
065e45188d
fix up tests 2017-03-23 20:18:41 +11:00
Erik Johnson
5ad476936d Overhaul Docker support
This does the following:

- Splits states for container/volume/image/network management into four
  separate state modules.

- Preserves backward compatibility by making ``docker.image_present``
  invoke ``docker_image.present``, etc.

- Changes how Salt detects that a container needs to be replaced.
  Instead of comparing each passed argument to the named container's
  configuration, it creates a temporary container, and compares that
  container to the named container. If the two differ, then the older
  container is removed, and the new one is renamed and started, becoming
  the named container.

- Removes the unit tests for container management and replaces them with
  integration tests.

- Adds unit tests for the new salt.utils.docker
2017-03-21 16:53:19 -05:00
Erik Johnson
6caedb0de8 Change imports for dockerng tests
This should fix path issues in the test suite.
2017-03-21 11:56:29 -05:00
Bo Maryniuk
52125c732b Pylint: W1699 2017-03-20 22:31:54 +01:00
Bo Maryniuk
fa8bd76c8b Fix unit test for a deprecation decorator policy 2017-03-20 22:31:54 +01:00
Bo Maryniuk
717c39bb4c Add unit test for batch call 2017-03-20 22:31:53 +01:00
Bo Maryniuk
88dc91f9a7 Add unit test for typed returns 2017-03-20 22:31:53 +01:00
Bo Maryniuk
af81a00130 Add unit test for None returns 2017-03-20 22:31:53 +01:00
Bo Maryniuk
88c6e9485b Add docstring to the unit test 2017-03-20 22:31:53 +01:00
Bo Maryniuk
4fa3793bee Add unit test for module.xrun call with the correct unnamed arguments 2017-03-20 22:31:53 +01:00
Bo Maryniuk
796b0e2690 Add unit test to call a function with an unexpected keywords 2017-03-20 22:31:53 +01:00
Bo Maryniuk
2314b49f54 Add unit test to call function with a proper arguments 2017-03-20 22:31:53 +01:00
Bo Maryniuk
3ab7d6c458 Refactor unit tests for reusing constants 2017-03-20 22:31:53 +01:00
Bo Maryniuk
3d63165f16 Add unit test for missing args 2017-03-20 22:31:53 +01:00
Bo Maryniuk
33a16d69cc Add xrun unit test for module is ran in a test mode 2017-03-20 22:31:53 +01:00
Bo Maryniuk
6bbf7232a1 Add test for module is not available 2017-03-20 22:31:53 +01:00
Bo Maryniuk
803b3ce637 Fix existing tests by proper patching and reusing existing constants 2017-03-20 22:31:53 +01:00
Nicole Thomas
08d6b96171 Merge pull request #39977 from bodhi-space/infra4506
INFRA-4506 - various fixes as detailed below
2017-03-14 15:52:32 -06:00
rallytime
f6cd372358 Update boto_asg state file unit test mocks to account for changes in #3997 2017-03-14 14:05:20 -06:00
Pedro Algarvio
0b41b92d7d
Use salt.utils.versions instead of distutils.version 2017-03-08 19:22:33 +00:00
Mike Place
71410047f0 Merge pull request #39682 from ni3mm4nd/mongodb_user
Add support for user roles in present state
2017-03-02 10:17:38 -07:00
Mike Place
320b39bc12 Fix broken test and lint issue 2017-03-01 11:57:28 -07:00
Mike Place
4a0c2dfcc3 Merge pull request #39725 from bodhi-space/infra4487
INFRA-4487 - 'test=True' should return True rather than None if no changes are scheduled.
2017-03-01 10:02:11 -07:00
Kadlec Jan
d5d99d6399 recteate unit tests 2017-03-01 07:13:28 +01:00
Tom Williams
aa8d822e78 INFRA-4487 - fix unit test to match corrected return value 2017-02-28 21:01:57 -05:00
Pedro Algarvio
40a64191a1
Absolute imports and A LOT of code cleanup. 2017-03-01 01:33:07 +00:00
Pedro Algarvio
3beb3fb801
Move whatever we need from salttesting to salt.
Let's drop the salttesting dependency cycle.
2017-02-28 22:52:49 +00:00
Pedro Algarvio
1e2753c875
Fix imports after renames 2017-02-23 23:19:43 +00:00
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00
Pedro Algarvio
e48ea8fa1b
Don't use assert_called_once() or assert_not_called().
These worked in Py2 but not in Py3.
A read of http://engineroom.trackmaven.com/blog/mocking-mistakes/ specially the section "Mocking the unexpected" will enlighten one.
2017-02-23 10:40:58 +00:00
rallytime
2595ac383d Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/config/__init__.py
  - salt/modules/docker.py
  - salt/states/docker.py
2017-02-22 16:24:36 -07:00
rallytime
c613d19e76 Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/modules/dockerng.py
  - salt/states/dockerng.py
2017-02-21 13:59:14 -07:00
Erik Johnson
c673d06f48 Rename dockerng state/execution module to docker 2017-02-18 21:58:25 -06:00
Erik Johnson
6e24dd85c4 Remove dockerio state/module (moved to salt-contrib) 2017-02-18 21:58:24 -06:00
Pedro Algarvio
90adbe925f
Force dictionary order 2017-02-17 20:48:56 +00:00
Pedro Algarvio
1d060096e3
Force ordering under Py3 2017-02-17 20:48:55 +00:00
Mike Place
e652a45592
Fix mocks in win_disim tests 2017-02-16 12:26:49 -07:00
Nicole Thomas
3a39e15dff Rewrite blockdev unit test to target more specific state returns (#39402)
The previous way this test was written was over-mocking some of the
state returns as well as tested and asserted against incorrect
behavior as shown in issue #39255. (The test asserted that a return
of '' from the call to _checkblk() was correct, which was hiding a
bug as noted in #39255 and fixed in #39272.)
2017-02-14 13:49:14 -07:00
rallytime
609e6e4b23 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/config/__init__.py
  - salt/modules/win_lgpo.py
  - salt/utils/aws.py
  - tests/unit/utils/schema_test.py
2017-02-09 10:29:40 -07:00
nicholasmhughes
8d8ba9c7d2 added the new getconfig function to the test 2017-02-06 09:55:09 -05:00
rallytime
ee2edda14e [PY3] Test comment contents more carefully for list stability
Stabilizes these tests by avoiding errors when cheese, crackers
order changes in the comment and gives errors like:

-  'comment': 'Kernel modules crackers, cheese are already present',
?                                     --------

+  'comment': 'Kernel modules cheese, crackers are already present',
?                            ++++++++
2017-02-02 22:34:20 +00:00
Winston Liu
c2d35d181f update botocore dependencies, skip if not met. 2017-01-31 10:49:34 -08:00
Julien BONACHERA
1e06f388bb make openvswitch state work with python3 (#38873)
* openvswitch: add a basic unit test for openvswitch

* openvswitch: enclose comments_* variables into a map

* openvswitch: only prepare error messages if type parameter is present

* openvswitch: add test case: create a GRE port

* openvswitch: remove trailing whitespace

* openvswitch: add missing "comments" variable

* openvswitch: pep8 compliance

* openvswitch: mock dig.check_ip

* openvswitch: rename "type" argument into "tunnel_type"

* openvswitch: reference bridge_exists before assignment

* openvswitch: reference port_list before assignment

* openvswitch: add upgrade note about "type" option renaming
2017-01-30 09:56:10 -07:00
rallytime
3f74d697b9 Merge branch '2016.11' into 'develop'
Conflicts:
  - pkg/windows/build_pkg.bat
  - salt/modules/archive.py
2017-01-20 12:07:19 -07:00
Erik Johnson
d10c068e25 Update archive state unit tests to reflect symlinks in archive.list 2017-01-20 08:49:40 -06:00
Mike Place
67383b01e1 Merge pull request #38717 from rallytime/py3-test-fixes
A couple of Python 3 compatibility fixes
2017-01-14 22:44:28 -07:00
rallytime
29fec06671 [module_test.py] Don't rely on list ordering: assert items are in
comment
2017-01-12 14:19:31 -07:00
Alexandru Bleotu
0b848ec184 Fixed WinrepoTestCase.test_genrepo to load BASE_FILE_ROOTS_DIR from salt.syspaths 2017-01-05 17:31:33 +00:00
rallytime
9ad362fbde Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/states/kapacitor.py
2017-01-03 10:17:18 -05:00
Mike Place
aa0c843553 Merge pull request #38461 from alprs/fix-kapacitor_changes
Improvements/fixes to kapacitor task change detection
2016-12-29 10:08:46 -07:00