Commit Graph

56 Commits

Author SHA1 Message Date
Ch3LL
fc70884ca1
Reload matcher loader when ext_pillar_first set 2019-05-06 17:57:11 -04:00
Wayne Werner
ee3115fa94
Allow leading dots and / as pillar separators 2019-04-09 18:11:44 -05:00
Pedro Algarvio
0f5525dcc2
Fix mocking 2018-12-28 13:22:09 +00:00
rallytime
82e73fe49d
Merge branch '2018.3' into 'fluorine'
Conflicts:
  - doc/ref/tops/all/index.rst
  - salt/fileclient.py
  - salt/grains/core.py
  - salt/modules/win_file.py
  - salt/pillar/__init__.py
  - salt/utils/http.py
2018-10-18 10:41:42 -04:00
Erik Johnson
f59506d4cc
Update tests to reflect behavior changes 2018-10-15 10:16:44 -05:00
Erik Johnson
0125185fdb
lint 2018-09-24 15:54:49 -05:00
Erik Johnson
b829729fec
Fix pillar unit tests to work properly with loader-based matchers 2018-09-24 15:43:19 -05:00
C. R. Oldham
34d3ef0900
Remove Matcher class and use the bare loader. 2018-09-21 09:35:58 -06:00
rallytime
18936bc5c1
Add optimization_order to unit test mocks 2018-08-14 13:40:46 -04:00
rallytime
6e6091c3ba
Merge branch '2018.3' into 'fluorine'
Conflicts:
  - tests/integration/runners/test_cache.py
  - tests/support/case.py
2018-08-14 09:57:37 -04:00
rallytime
83a15cb623
Add optimization_order config to mocked opts 2018-08-13 12:06:48 -04:00
rallytime
201031fa8a
Merge branch '2017.7' into '2018.3'
Conflicts:
  - 	doc/man/salt.7
  - 	doc/ref/configuration/minion.rst
  - 	salt/cloud/clouds/ec2.py
  - 	salt/returners/highstate_return.py
  - 	tests/support/gitfs.py
  - 	tests/unit/loader/test_loader.py
2018-08-10 13:12:14 -04:00
Erik Johnson
0441cd56ef
Add optimization_order to mocking 2018-08-08 11:22:52 -05:00
rallytime
7dc1e770c4
Merge branch '2018.3' into 'develop'
Conflicts:
  - doc/topics/installation/freebsd.rst
  - salt/cloud/clouds/oneandone.py
  - salt/grains/core.py
  - salt/modules/napalm_ntp.py
  - salt/modules/win_update.py
  - salt/modules/win_wua.py
  - salt/modules/zabbix.py
  - salt/renderers/pass.py
  - salt/states/vault.py
  - tests/unit/states/test_win_update.py
2018-06-06 13:35:36 -04:00
rallytime
3273bbdab7
Merge branch '2017.7' into '2018.3'
Conflicts:
  - doc/ref/configuration/master.rst
  - doc/ref/modules/all/index.rst
  - doc/topics/grains/index.rst
  - doc/topics/releases/2016.3.4.rst
  - doc/topics/spm/spm_formula.rst
  - doc/topics/tutorials/cron.rst
  - doc/topics/tutorials/index.rst
  - doc/topics/tutorials/stormpath.rst
  - salt/engines/slack.py
  - salt/log/handlers/fluent_mod.py
  - salt/modules/cyg.py
  - salt/modules/junos.py
  - salt/modules/namecheap_dns.py
  - salt/modules/namecheap_domains.py
  - salt/modules/namecheap_ns.py
  - salt/modules/namecheap_ssl.py
  - salt/modules/namecheap_users.py
  - salt/modules/reg.py
  - salt/modules/tomcat.py
  - salt/modules/vault.py
  - salt/modules/win_file.py
  - salt/modules/zpool.py
  - salt/output/highstate.py
  - salt/renderers/pass.py
  - salt/runners/cache.py
  - salt/states/boto_apigateway.py
  - salt/states/boto_iam.py
  - salt/states/boto_route53.py
  - salt/states/msteams.py
  - salt/states/reg.py
  - salt/states/win_iis.py
  - tests/integration/modules/test_cmdmod.py
  - tests/integration/states/test_user.py
  - tests/support/helpers.py
  - tests/unit/cloud/clouds/test_openstack.py
  - tests/unit/fileserver/test_gitfs.py
  - tests/unit/modules/test_junos.py
  - tests/unit/pillar/test_git.py
  - tests/unit/states/test_win_path.py
  - tests/unit/test_pillar.py
  - tests/unit/utils/test_format_call.py
  - tests/unit/utils/test_utils.py
  - tests/unit/utils/test_warnings.py
2018-06-01 14:54:12 -04:00
Erik Johnson
93ee5ee2b0
Fix all Sphinx warnings
Well, all but one, which we expect to see
2018-05-31 15:28:25 -05:00
Erik Johnson
d185f97a47
mocked file_roots and pillar_roots should be dicts 2018-04-18 13:20:07 -05:00
Erik Johnson
3df82869d0
Mock __gather_avail in test_includes_override_sls 2018-04-18 13:15:00 -05:00
Erik Johnson
af83a5755d
mocked file_roots and pillar_roots should be dicts 2018-04-18 13:00:33 -05:00
Erik Johnson
ba4ac60787
Remove trailing whitespace 2018-04-18 12:59:57 -05:00
rallytime
5b50eaf6b0
Merge branch '2018.3' into 'develop'
Conflicts:
  - doc/ref/proxy/all/salt.proxy.cimc.rst
  - doc/ref/proxy/all/salt.proxy.panos.rst
  - doc/topics/releases/2018.3.0.rst
  - salt/modules/cmdmod.py
  - salt/modules/state.py
  - salt/utils/schedule.py
  - tests/integration/modules/test_state.py
2018-04-05 13:25:46 -04:00
rallytime
e312efb5e7
Merge branch '2017.7' into '2018.3'
Conflicts:
  - doc/man/salt-api.1
  - doc/man/salt-call.1
  - doc/man/salt-cloud.1
  - doc/man/salt-cp.1
  - doc/man/salt-key.1
  - doc/man/salt-master.1
  - doc/man/salt-minion.1
  - doc/man/salt-proxy.1
  - doc/man/salt-run.1
  - doc/man/salt-ssh.1
  - doc/man/salt-syndic.1
  - doc/man/salt-unity.1
  - doc/man/salt.1
  - doc/man/salt.7
  - doc/man/spm.1
  - salt/modules/cmdmod.py
  - salt/modules/pillar.py
  - salt/modules/yumpkg.py
  - salt/state.py
  - salt/utils/pkg/rpm.py
  - salt/utils/schedule.py
  - tests/integration/states/test_npm.py
  - tests/integration/states/test_pkgrepo.py
2018-03-27 16:31:55 -04:00
rallytime
2c4668a5cb
Merge branch '2018.3' into 'develop'
Conflicts:
  - salt/modules/kubernetes.py
  - salt/states/netconfig.py
  - salt/states/zfs.py
  - tests/integration/cloud/providers/test_profitbricks.py
  - tests/integration/scheduler/test_eval.py
  - tests/unit/grains/test_core.py
  - tests/unit/test_pillar.py
2018-03-27 11:57:29 -04:00
Nicole Thomas
fadc5e4ba4
Merge pull request #46669 from terminalmage/pillar-merge-order
Add option to return to pre-2017.7.3 pillar include merge order
2018-03-26 15:00:27 -04:00
Erik Johnson
b4a1d34b47
Add option to return to pre-2017.7.3 pillar include merge order
https://github.com/saltstack/salt/pull/45025 changed the pillar include
merge order. This adds a new config option which allows a user to revert
to the pre-2017.7.3 behavior.
2018-03-22 13:35:12 -05:00
rallytime
0f728186aa
Fix pillar unit test failures: file_roots and pillar_roots environments should be lists 2018-03-20 17:49:58 -04:00
rallytime
46ba72fb1c
Fix pillar unit test failures: file_roots and pillar_roots environments should be lists 2018-03-20 17:32:21 -04:00
rallytime
8d1e1e7f94
Merge branch '2017.7' into '2018.3'
Conflicts:
  - .kitchen.yml
  - Gemfile
  - pkg/windows/build_env_2.ps1
  - pkg/windows/build_env_3.ps1
  - pkg/windows/req.txt
  - salt/client/ssh/__init__.py
  - salt/client/ssh/ssh_py_shim.py
  - salt/modules/boto_vpc.py
  - salt/modules/file.py
  - salt/modules/heat.py
  - salt/modules/smartos_vmadm.py
  - salt/modules/win_dsc.py
  - salt/returners/elasticsearch_return.py
  - salt/runners/salt.py
  - salt/states/module.py
  - salt/utils/win_functions.py
  - setup.py
  - tests/integration/modules/test_state.py
  - tests/unit/grains/test_core.py
  - tests/unit/test_pillar.py
2018-03-15 17:22:05 -04:00
Benjamin Drung
584b451fd1 Support dynamic pillar_root environment
Allow users to specify a __env__ pillar_root directory that applies
equally to all environments that are not explicitly specified.

fixes #20581
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-03-08 10:12:40 +01:00
Marlowe W
928a7a93f9 fix lint 2018-01-26 13:18:40 +08:00
Marlowe W
5875d338a7 fix test_malformed_pillar_sls 2018-01-22 11:22:24 +08:00
Marlowe W
b480d5343b split pillar include unit test 2018-01-15 12:50:28 +08:00
rallytime
60370f5fb6
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/config/__init__.py
  - salt/daemons/masterapi.py
  - salt/proxy/dummy.py
  - salt/states/file.py
  - tests/integration/modules/test_state.py
  - tests/integration/runners/test_runner_returns.py
  - tests/integration/ssh/test_state.py
  - tests/support/parser/__init__.py
  - tests/unit/grains/test_core.py
  - tests/unit/states/test_file.py
2018-01-11 16:00:08 -05:00
Marlowe W
a49eec774e
add unit test on wildcard in include 2018-01-06 17:00:01 +08:00
Marlowe W
976244b62d fix pylint in test_pillar 2018-01-06 13:27:27 +08:00
Marlowe W
e6205b2301
fix PillarTestCase 2018-01-06 11:22:10 +08:00
Steve Weber
942c14bb29
pillar body overrides includes
vars in pillar body override pillar includes
2018-01-04 17:33:39 -05:00
Steve Weber
507d854b3c
pillar body overrides includes
vars in pillar body override pillar includes
2018-01-03 00:04:32 -05:00
Erik Johnson
683e2cc502
Rename 'environment' config option to 'saltenv'
'environment' predates the 'saltenv' nomenclature, and since we have
been using saltenv on the CLI for years, and now also have pillarenv, it
makes sense to make this change.
2017-11-30 13:08:49 -06:00
rallytime
b8dc018178
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/opkg.py
  - salt/utils/templates.py
  - tests/unit/templates/test_jinja.py
2017-10-18 09:37:47 -04:00
twangboy
00dbba5712
Fix unit.test_pillar for Windows
Use delete=True in NamedTemporaryFile command otherwise the handle to
the file isn't released and the file can't be opened by the actual test.
2017-10-10 13:44:58 -06: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
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
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
Andrew Pashkin
b0148c15c7 Revert "Make possible to reference previous pillars from subsequent pillars, as they specified in the top file" 2017-07-19 12:25:22 +03:00
Andrew Pashkin
7d59f7a6c6 Make possible to reference pillars, that come before current pillar in the top file 2017-07-12 19:03:05 +03:00
Marlowe W
d66281bda6 pillar: fix tests 2017-05-26 13:41:21 +08:00