Commit Graph

393 Commits

Author SHA1 Message Date
rallytime
522d600772
Merge branch '2018.3' into 'develop'
No conflicts.
2018-06-11 11:51:49 -04:00
Erik Johnson
b33a0b5eaa
Switch to trace level logging for further test failure troubleshooting 2018-06-08 17:06:49 -05:00
rallytime
d991430715
Merge branch '2018.3' into 'develop'
No conflicts.
2018-06-07 13:03:54 -04: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
Erik Johnson
41e5a75027
Add catch_timeout to run_script
One of the tests depends on forcing a timeout, but since we no longer
include the timeout message in the stdout/stderr return, we needed a way
to return whether or not the script timed out.
2018-06-06 09:04:09 -05:00
Erik Johnson
a1ce0631fd
Use @property instead of @staticmethod for config_dir
We're not passing arguments and we're just getting back a string
contstant, so there's no need to make this a staticmethod.
2018-06-05 14:10:33 -05:00
Nicole Thomas
a46e42ab11
Merge pull request #47927 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-06-04 14:55:11 -04:00
Erik Johnson
9c369c6aa8
Remove temp logging from test
It's now being logged in run_script itself
2018-06-04 00:19:30 -05:00
Erik Johnson
fb66368af9
Update test logging for salt-jenkins 1000 2018-06-02 21:39:17 -05:00
rallytime
be8d34ec21
Merge branch '2018.3' into 'develop'
No conflicts.
2018-06-01 15:19:09 -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
25afc932f7
WIP salt-jenkins issue 1000
This adds logging of the output and retcode when the output file fails
to be created. As I have thus far been unable to reproduce this locally,
this is the best shot at seeing what is causing the issue, since
ShellCase's run_script is rather opaque about what happens in the script
itself. We do know from the salt-runtests.log that the `salt-call -g` is
successfully returning, what we don't know is what happened after that
data was returned, and this should provide that insight.
2018-05-30 11:40:51 -05:00
rallytime
8d3c2be61c
Merge branch '2018.3' into 'develop'
Conflicts:
  - salt/modules/kubernetes.py
  - salt/modules/opkg.py
  - salt/modules/useradd.py
  - salt/output/table_out.py
  - salt/states/mysql_query.py
  - salt/states/user.py
2018-05-23 12:57:58 -04:00
rallytime
dd3e6f3f0a
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/states/pkgrepo.py
2018-05-15 12:29:29 -04:00
Ch3LL
31f13a4197
sysloghander: check for 3.5.4 python version 2018-05-10 14:12:15 -04:00
Nicole Thomas
9e6f58c646
Lint: Remove extra blank line 2018-05-09 10:57:21 -04:00
Ch3LL
a020352a03
Catch Sysloghandler errors when log file does not exist 2018-05-08 15:12:35 -04:00
Matt Phillips
f1dbb5694f update docs to reference new feature 2018-05-08 09:42:23 -04:00
Matt Phillips
fec6c70cf3 add some tests for compound nodegroup matching 2018-05-07 16:41:44 -04:00
rallytime
4ad50bbdee
Update old utils paths to new paths 2018-04-03 14:46:56 -04:00
rallytime
e8864b7b0b
Merge branch '2017.7' into '2018.3' 2018-03-28 13:52:28 -04:00
Ch3LL
4f1c42c0e3
Workaround getpwnam in auth test for MacOSX 2018-03-27 15:18:29 -04:00
rallytime
d83727fdf9
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/cli/api.py
  - salt/client/ssh/wrapper/state.py
  - salt/config/__init__.py
  - salt/crypt.py
  - salt/daemons/masterapi.py
  - salt/key.py
  - salt/loader.py
  - salt/master.py
  - salt/modules/archive.py
  - salt/modules/hipchat.py
  - salt/modules/pip.py
  - salt/modules/state.py
  - salt/modules/virt.py
  - salt/modules/x509.py
  - salt/state.py
  - salt/transport/tcp.py
  - salt/transport/zeromq.py
  - salt/utils/__init__.py
  - salt/utils/event.py
  - salt/utils/extmods.py
  - salt/utils/files.py
  - salt/utils/parsers.py
  - salt/utils/verify.py
  - tests/integration/shell/test_call.py
  - tests/unit/utils/test_args.py
2018-03-06 13:45:59 -05:00
Erik Johnson
31b1d98fcb
Replace direct use of os.umask with use of existing context manager
In cases where os.umask was being used simply to get the umask, a new
helper function has been added to keep improper direct usage of os.umask
from permanenly modifying the umask.
2018-02-27 23:42:51 -06:00
Daniel Wallace
9ce14b2a12
pass opts to SSHClient for enable_ssh_minions
Also, use ckminions to get the minions from the roster, instead of doing it in
publish.
2018-02-20 16:06:00 -07:00
rallytime
fb4f2dd0fa
Distinguish between Authorization and Authentication errors
And handle the error distiction being returned from the publish function
instead of sending empty strings.
2018-01-23 17:05:22 -05:00
Erik Johnson
49dd5b32e9
[PY3] Add unicode_literals to acl, auth, and netapi modules 2018-01-05 10:31:11 -06:00
Erik Johnson
002aa88a97
Replace yaml usage with a helper to ensure unicode is handled properly
Without allow_unicode=True, unicode characters are processed through the
str representer and on Python 2 are dumped as a Unicode code point (i.e.
a literal \u0414). This commit makes allow_unicode=True the default in
our salt.utils.yamlloader.safe_dump() helper. It also adds a new
salt.utils.yamlloader.dump() helper which wraps yaml.dump() and also
makes allow_unicode=True the default.

To make importing and using our custom yaml loader/dumper easier, a
convenience module called salt.utils.yaml has been added, which does a
wildcard import from both salt.utils.yamldumper and
salt.utils.yamlloader.

Refs to yaml.load/dump and yaml.safe_load/safe_dump have been updated to
salt.utils.yaml, to ensure that unicode is handled properly.
2018-01-03 14:14:21 -06:00
Erik Johnson
7b13a7df8b
Replace json module usage with a helper to ensure unicode content is handled properly
This adds wrappers for json.dump{,s} which disable `ensure_ascii` by
default.
2017-12-27 09:30:58 -06: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
e631ce1276
Merge pull request #45030 from terminalmage/moar-unicode
[PY3] Add unicode_literals to tops, thorium, proxy, tokens
2017-12-15 12:04:05 -05:00
Erik Johnson
239fc8d774
[PY3] Add unicode literals to the clients and associated files/tests 2017-12-15 00:19:55 -06:00
Erik Johnson
7147ac69ac
Add unicode_literals to tops, thorium, proxy, tokens 2017-12-14 21:56:49 -06: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
Ch3LL
d8f81d2e4d
fix pylint 2017-12-05 14:39:36 -05:00
Ch3LL
61ac5cf157
Add spm -y and -f arg integration tests 2017-12-04 16:06:14 -05:00
Ch3LL
9b7421b261
Change check to the state id 2017-11-29 10:15:56 -05:00
Ch3LL
9cc853e3d5
Add masterless state.highstate integration test 2017-11-29 10:15:56 -05:00
Ch3LL
b3b5ecc6ff
Add pillar.items test for masterless 2017-11-22 15:40:57 -05:00
rallytime
1dea504f2d
Replace util path references with new ones 2017-11-22 12:44:36 -05: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
Ch3LL
359a59dd64
Add salt-key -d integration test 2017-11-21 10:40:25 -05: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
Ch3LL
d2e91c33bd
Add spm shell tests 2017-10-12 15:31:48 -04:00
rallytime
93c11d827a Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/engines/slack.py
  - salt/minion.py
2017-08-17 09:30:50 -04:00
Erik Johnson
8165f46165 Add debug logging to troubleshoot test failures
This adds logging to troubleshoot https://github.com/saltstack/salt-jenkins/issues/477
2017-08-14 16:28:09 -05: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
Erik Johnson
462d653082 Move weird tearDown test to an actual tearDown
Also catch KeyError when user doesn't exist
2017-08-11 12:20:50 -05: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