Commit Graph

30 Commits

Author SHA1 Message Date
Erik Johnson
5adf852615
Add unicode_literals to runner modules 2017-12-14 19:30:14 -06:00
Daniel Wallace
1b8bd64a88 Merge branch 'develop' into develop 2017-10-24 10:42:22 -06:00
Erik Johnson
877abb89d0
Complete the salt.utils refactor
This moves the remaining 30 functions from salt.utils to new locations.
2017-10-15 09:43:31 -05:00
SK
97561ac011 autotests 2017-09-13 19:19:00 +03: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
Mike Place
778c1c94bd Merge pull request #40522 from carlpett/vault-fix-master-minion
Salt-vault: Fix handling of None-grains
2017-04-04 13:33:56 -06:00
Nicole Thomas
579794dd64 Remove extra blank line for lint 2017-04-04 10:20:31 -06:00
Calle Pettersson
c5d33ba065 Salt-vault: Fix handling of None-grains 2017-04-04 16:50:35 +02:00
Pedro Algarvio
a15aa32404
Proper mocking. 2017-04-01 14:22:59 +01:00
Pedro Algarvio
d05028e88c
These are not integration tests 2017-04-01 14:22:51 +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
1f7a0aa65b
Proper mocking 2017-03-28 19:00:51 +01:00
Calle Pettersson
c745415b8b Vault: Always lowercase policies 2017-03-03 09:05:27 +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
Mike Place
ec79d238fb Merge pull request #39732 from gtmanfred/develop
Add queueing of runner tasks using the scheduler and queue runner
2017-02-28 15:09:43 -07:00
Daniel Wallace
39bb623bdc fix pylint 2017-02-28 14:53:02 -06:00
Daniel Wallace
878b21662e add test for queue 2017-02-28 14:10:41 -06:00
Calle Pettersson
4154910dd3 Vault: Handle patterns with non-existing keys 2017-02-28 21:07:49 +01:00
Calle Pettersson
6dac1c710e Vault: Add support for expanding lists in policies 2017-02-27 19:55:26 +01:00
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00
Dmitry Kuzmenko
63d8246a5c Modular minion data cache.
Grains, pillar and mine data are now managed by salt.cache subsystem
2016-08-15 10:34:01 +03:00
rallytime
9220ea0729 Merge branch '2016.3' into 'develop'
Conflicts:
  - doc/conf.py
  - salt/minion.py
  - salt/modules/mac_brew.py
  - salt/modules/pkgng.py
  - salt/states/apache_module.py
  - salt/states/ini_manage.py
  - salt/states/win_servermanager.py
2016-06-02 10:13:34 -04:00
Blaine Chatman
7599b18995 fix jobs.list_jobs failing with search_target 2016-05-24 17:56:45 -07:00
justinta89
053ae0cae6 Updated tests to work with code deprecations 2016-02-11 11:22:35 -07:00
Justin Findlay
0c0bce3ea6 cache runner test: add new unit tests 2015-11-18 16:33:46 -07:00