Commit Graph

20 Commits

Author SHA1 Message Date
rallytime
d8e7c47a05
Merge branch '2017.7' into '2018.3'
Conflicts:
  - tests/support/case.py
2018-11-12 16:11:17 -05:00
Daniel A. Wozniak
794ba17c94
Reset date and time after changing 2018-11-12 00:43:22 -07:00
twangboy
3600467a04
Fix some try/except blocks, mark a lazy test 2018-09-18 10:56:51 -06:00
Daniel A Wozniak
b332bebb20
Fix archive tests for py3 2018-08-29 00:35:17 -07:00
Daniel A. Wozniak
8ea89e943f
Test fixes
- Fix tearDown method to remove unicode environment key.
- Mark flaky test as such, test_set_system_time fails when run at
  certian times of the day.
2018-08-18 20:59:36 -07:00
Daniel A. Wozniak
559ee1961f
Sysname returns text type 2018-05-03 09:16:21 -07:00
rallytime
fefc0cc3ca
Update old utils paths to use new utils paths 2018-04-27 13:44:44 -04:00
rallytime
13e8124031
Merge branch '2017.7' into '2018.3'
Due to the many merge conflicts created from #47106 against the 2017.7 branch
and #46002 against the 2018.3 branch, the changes from #47106 have been largely
removed from this merge forward and the HEAD of 2018.3 was taken.

A separate fix for Tornado 5.0 support will need to be made directly against the
2018.3 branch.

Conflicts:
  - doc/topics/development/conventions/formulas.rst
  - salt/master.py
  - salt/minion.py
  - salt/netapi/rest_tornado/saltnado.py
  - salt/states/zfs.py
  - salt/transport/ipc.py
  - salt/transport/tcp.py
  - salt/transport/zeromq.py
  - salt/utils/async.py
  - tests/support/helpers.py
  - tests/support/parser/cover.py
  - tests/unit/grains/test_core.py
  - tests/unit/modules/test_ssh.py
  - tests/unit/test_minion.py
  - tests/unit/utils/test_safe_walk.py
2018-04-27 13:38:35 -04:00
Ch3LL
c9181a75a6
Add destructivetest decorator on tests 2018-04-24 14:44:15 -04:00
Ch3LL
0d0c8987fc
Add win_system integration module tests 2018-04-24 14:37:14 -04:00
Erik Johnson
99de368afa
PY2: Fix system.set_computer_desc and set_computer_desc when desc is unicode
Both string_escape and unicode_escape don't like unicode content. This
scraps the escape encoding and simply does a series of string
replacements to disabmibguate quotes, newlines, and tab characters.
2018-02-01 10:30:12 -06:00
Gareth J. Greenaway
b3c1be27fb
Tier two unicode updates for modules, states and related tests. 2018-01-25 11:59:25 -08: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
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
Pedro Algarvio
7b713d9256
Use the more portable helper skip_if_not_root. 2017-04-04 18:58:21 +01:00
Pedro Algarvio
61003bca0a
Take care of resource leakage on tests 2017-04-04 18:58:20 +01:00
Pedro Algarvio
2ee6d5d589
Import from the original modules not tests.integration 2017-04-04 18:58:19 +01: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
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00