Commit Graph

3127 Commits

Author SHA1 Message Date
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
rallytime
6a7bf99848 Lint fix: add missing space 2017-08-11 14:19:15 -04:00
rallytime
7f46603e9c Update account id value in boto_secgroup module unit test
This value was updated in moto 1.0.0 with the following commit:

5f3fbff627
2017-08-10 17:31:14 -04:00
rallytime
7c1d493fdd @mock_elb needs to be changed to @mock_elb_deprecated as well 2017-08-10 17:15:45 -04:00
rallytime
3055e17ed5 Replace @mock_ec2 calls with @mock_ec2_deprecated calls
moto versions >= 1.0.0 have changed the way the mocked connections through
boto are handled with the @mock_ec2 decorator. They use the boto3 connection
method. However, since we are still using boto in many places, we need to use
the new @mock_ec2_deprecated decorator instead to handle the boto connection
functions for the unit tests.

Versions of moto < 1.0.0 are not Python 3 compatible, so salt-jenkins should
be installing newer versions of moto for those tests. Unfortunately, we cannot
install an older version of moto for Python2 that use the original @mock_ec2 call
and also import the @mock_ec2_deprecated function for newer versions of moto
simultaneously as the @mock_ec2_deprecated function doesn't exist in older
versions of moto.
2017-08-10 16:40:11 -04:00
Nicole Thomas
e6357abdda Merge pull request #42718 from moio/yumpkg-list_pkg-attr-parameter
yumpkg.list_pkgs: add parameter for returned attribute selection
2017-08-09 16:58:02 -04:00
Silvio Moioli
5a15e53886 yumpkg.list_pkg: add/adapt tests
This includes changes to the zypper tests because of the refactoring that
affected both modules.
2017-08-09 11:43:56 +02: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
f20f3742cb Merge branch '2017.7' into 'develop'
Conflicts:
  - tests/unit/test_crypt.py
2017-08-07 10:43:06 -04:00
Mike Place
834d6c605e
Set fact gathering style to 'old' for test_junos
Without this, we stacktrace because it does not appear that setting
'gather_facts' to False prevents the library from assuming the presence
of facts. I believe this to be an upstream bug with jnpr.

Because they have listed this as being a deprecated option in the future
this may re-break in the future.
2017-08-02 23:11:52 -06:00
Mike Place
a09091a696 Merge pull request #42517 from alexbleotu/linux_acl_fixes-gh
Fixes to linux_acl.present state & cmd.run function
2017-07-31 14:44:57 -05:00
garethgreenaway
bab7503f68 Merge branch 'develop' into linux_acl_fixes-gh 2017-07-27 16:59:36 -07:00
rallytime
9b66464fcc Merge branch '2017.7' into 'develop'
No conflicts.
2017-07-27 13:52:52 -06:00
Mike Place
2985e4c0e6 Merge pull request #42255 from twangboy/win_unit_test_win_system
Fix `unit.modules.test_win_system` for Windows
2017-07-27 14:12:41 -05:00
Mike Place
71b4c86a40 Merge pull request #42430 from alexbleotu/esxdatacenter_proxy-gh
Esxdatacenter proxy + related updates
2017-07-27 13:47:10 -05:00
rallytime
1f0b90aa57 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cloud/clouds/joyent.py
  - salt/engines/slack.py
2017-07-26 17:51:36 -06:00
Alexandru Bleotu
4715c8eca3 Merge branch 'develop' into linux_acl_fixes-gh 2017-07-25 23:36:52 +01:00
Alexandru Bleotu
c565ed94dd Merge branch 'develop' into esxdatacenter_proxy-gh 2017-07-25 23:36:25 +01:00
Mike Place
fa519b76d0 Merge pull request #42310 from moio/zypper-list_pkg-attr-parameter
zypper.list_pkgs: add parameter for returned attribute selection
2017-07-25 16:07:45 -05:00
Alexandru Bleotu
89cebfd96b Merge branch 'develop' into linux_acl_fixes-gh 2017-07-25 21:54:46 +01:00
Alexandru Bleotu
0f3d784c0f Updated all tests for modules.mod_acl and added one when the error is raised 2017-07-24 19:35:06 +01:00
Nicole Thomas
c793d83d26 Merge pull request #42180 from twangboy/win_unit_test_timezone
Fix `unit.modules.test_timezone` for Windows
2017-07-24 08:46:16 -06:00
garethgreenaway
580c6989b3 Merge branch 'develop' into esxdatacenter_proxy-gh 2017-07-21 10:45:53 -07:00
Alexandru Bleotu
500899bc12 Fix tests #2 2017-07-21 08:18:57 +01:00
Alexandru Bleotu
0ba680f68e Merge branch 'develop' into datacenter_vsphere_func-gh 2017-07-21 07:58:56 +01:00
Silvio Moioli
5e23f5d678 zypper.list_pkgs: add install_time_date_t as a supported attribute 2017-07-21 08:15:50 +02:00
Silvio Moioli
db22777a09 zypper_test: add test for list_pkgs and attr 2017-07-21 08:14:37 +02:00
Silvio Moioli
bb049cb70f zypper_test: adapt existing unit tests to new code 2017-07-21 08:14:37 +02:00
Silvio Moioli
a32ee4af05 zypper_test: correct mock behavior
Previously incorrect, although the test passed
2017-07-21 08:14:37 +02:00
Alexandru Bleotu
7f52358eac Fixed test 2017-07-21 00:07:42 +01:00
Alexandru Bleotu
632cbf69b4 Fixed pylint 2017-07-20 22:22:24 +01:00
Erik Johnson
2fb986f5ca Merge pull request #42367 from rallytime/files-util
Move file-related utilities out of init file and into salt.utils.files.py
2017-07-19 16:55:52 -05:00
Alexandru Bleotu
89f4f324e6 Added tests for salt.modules.vsphere.create_datacenter 2017-07-19 17:20:24 +01:00
Alexandru Bleotu
b0aafe1632 Added tests for salt.modules.vsphere.list_datacenters_via_proxy 2017-07-19 17:20:23 +01:00
Nicole Thomas
59e012b485 Merge pull request #42150 from twangboy/win_unit_test_pip
Fix `unit.modules.test_pip` for Windows
2017-07-19 10:01:17 -06:00
Nicole Thomas
ade25c6b34 Merge pull request #42154 from twangboy/win_unit_test_reg
Fix `unit.modules.test_reg_win` for Windows
2017-07-19 10:00:38 -06:00
Nicole Thomas
07593675e2 Merge pull request #42182 from twangboy/win_unit_test_useradd
Fix `unit.modules.test_useradd` for Windows
2017-07-19 09:55:32 -06:00
Alexandru Bleotu
e041b8f486 Added tests for get_details in modules.esxdatacenter 2017-07-19 15:24:10 +01:00
Alexandru Bleotu
6814e8405d Added tests for supporting esxdatacenter proxy in modules.vsphere 2017-07-19 15:24:10 +01:00
rallytime
89d957b124 Update unit test mocks for salt.utils.files.fopen 2017-07-18 13:40:07 -06: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
rallytime
f59ecb7ffe Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/executors/sudo.py
2017-07-18 08:57:55 -06:00
rallytime
78cdee51d5 Gate boto_elb tests if proper version of moto isn't installed
For Python 2 tests, we can use an older version. But when running
these tests of Python 3, we need a newer version of moto that supports
Python 3.

This gates the tests if the expected version of moto is missing.
2017-07-11 17:00:50 -06:00
twangboy
acc0345bc8 Fix unit tests 2017-07-11 12:08:13 -06:00
Mike Place
e0c4a4bb1b Merge pull request #42192 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-07-07 13:59:30 -05:00
rallytime
bf45c18f9d Convert remaining "assert_called_once" references to new syntax
These tests are new to develop and need to be converted to use the new
assert_called_once syntax introduced in #42084.
2017-07-07 10:28:19 -06:00
rallytime
8d960d463a Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/grains/core.py
2017-07-06 17:42:30 -06:00
garethgreenaway
47ade9e91c Merge pull request #42088 from terminalmage/update-mocking
Update mocking in network tests
2017-07-06 15:03:42 -07:00
Jay
623ca64121 Merge branch 'develop' into patch-4 2017-07-06 16:58:53 -04:00
twangboy
8260a71c07 Disable tests that require pwd in Windows 2017-07-06 13:19:40 -06:00