Commit Graph

40 Commits

Author SHA1 Message Date
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
Erik Johnson
239fc8d774
[PY3] Add unicode literals to the clients and associated files/tests 2017-12-15 00:19:55 -06: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
c91bb18298 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - doc/ref/configuration/master.rst
  - salt/modules/pip.py
  - salt/states/saltmod.py
2017-05-04 11:49:33 -06:00
Ch3LL
ba223827b9
fix integration wheel test_gen test 2017-05-03 15:37:44 -04:00
Pedro Algarvio
2ee6d5d589
Import from the original modules not tests.integration 2017-04-04 18:58:19 +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
07d0a5ed20
Cleanup after ourselves 2017-03-08 18:34:32 +00: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
twangboy
34659761e8 Add issue number to skipIf 2017-02-24 09:31:47 -07:00
twangboy
e50ae8dd37 Fix wheel tests 2017-02-24 09:31:47 -07:00
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00
Mike Place
092aa89777 Add final args to disable event printing for wheel 2016-08-22 14:51:47 +09:00
Mike Place
2992bb8abc Fix args err in wheel test 2016-08-22 13:31:23 +09:00
Mike Place
b4f71e0260 Support the supression of prints in the wheel module
This will clean up all those pesky key output issues in the wheel tests.
2016-08-22 13:11:38 +09:00
Mike Place
7e8721b4c2 Fix wheel test to call correct wheel function
This was not causing a test failure because no asserts were being
made but it was throwing exceptions silently. This cleans that up.
2016-08-22 11:44:50 +09:00
rallytime
76e8dd974a Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/state.py
  - tests/integration/__init__.py
  - tests/integration/wheel/key.py
2016-07-26 11:05:24 -06:00
Mike Place
b4be66dedf Fix wheel test
Fix random ordering bug
2016-07-21 13:54:32 -06:00
rallytime
e8b7c0654b Be more explicit with salt.utils imports and usage 2016-06-29 15:59:42 -06:00
Pedro Algarvio
76c5e105b0
More conf fixes 2016-05-23 13:57:21 +01:00
Pedro Algarvio
3adf8e286e
Some more test suite run fixes
* Allow more time for the daemons to react to the signals sent
* Fix configuration
* More logging
2016-05-23 13:57:21 +01:00
Mike Place
8d3244166b Cast to dict to fix wheel tests in tcp 2015-11-12 12:21:52 -07:00
Pedro Algarvio
60f215f191 Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
Thomas Jackson
4db02487f1 Pass opts not an ImmutableDict of opts 2015-01-27 13:11:01 -08:00
Thomas S Hatch
5ab6743b85 Merge branch '2014.7' into develop 2014-10-13 20:06:17 -06:00
Seth House
b0615f9bbf Merge remote-tracking branch 'upstream/2014.7' into develop 2014-10-08 14:40:32 -06:00
Pedro Algarvio
8e93faa072 Fix lint errors 2014-10-08 01:02:11 +01:00
Pedro Algarvio
3de914e556 Move tests away from __init__ 2014-10-08 01:02:08 +01:00
Pedro Algarvio
d0ca8274ae Remove the unnecessary integration.ClientCase class 2014-10-08 01:00:19 +01:00
Pedro Algarvio
b32d86d0f4 Allow getting the configuration from scratch.
Properly handle `client_config` when loading from cache.
Only delete the `_client` attribute if it has been set.
2014-10-08 01:00:06 +01:00
Seth House
dd400f2e96 Added integration tests WheelClient cmd_sync cmd_async 2014-10-07 16:43:15 -06:00
Seth House
9bd61a1bd6 Added integration tests for wildcard eauth usernames 2014-10-03 13:28:29 -06:00
Seth House
0d07099444 Added integration tests for wildcard eauth usernames 2014-10-02 23:53:37 -06:00
vs
ca5e63ed24 create minions_denied in test-env, update wheel-test to expect minions_denied 2014-09-22 19:44:24 +02:00
Seth House
a96d58cfba Fix failing integration tests for the wheel client 2014-08-26 19:20:25 -06:00
Seth House
6f4cabf99c Added wheel test for testing token authentication 2013-12-19 21:07:46 -07:00
Thomas S Hatch
1216169d00 pylint 2013-12-13 16:32:08 -07:00
Seth House
7cfaca6ddb Add basic lowdata test for master_call 2013-12-13 16:00:34 -07:00
Seth House
f4ea6c2026 Added integration tests for two functions in the key wheel module 2013-12-13 16:00:19 -07:00