Commit Graph

800 Commits

Author SHA1 Message Date
twangboy
3df091f543
Put tests behind try block
Uninstall firefox in finally
Add some log messages
2017-12-11 15:18:03 -07:00
twangboy
6771659f30
Tests all 3 in one test 2017-12-11 15:18:03 -07:00
twangboy
0ed38e3f33
Add integration tests for chocolatey state 2017-12-11 15:18:03 -07:00
Erik Johnson
272044c688
Roll back use of explicit unicode literals 2017-12-10 17:41:45 -06:00
Gareth J. Greenaway
a380561180
Merge branch 'develop' into issue30842 2017-12-08 09:32:39 -08:00
Erik Johnson
1beb646a04
Handle the fact that attachable is unmanageable on Cent7 2017-12-06 12:12:26 -06:00
Erik Johnson
2eb58e6a5b
Remove use of auto_remove in docker_container integration tests
CentOS 7 still ships a version of Docker with API version 1.24 which
does not support this argument. This commit uses `docker.rm` to remove
the container manually after the state is run, in cases where we were
using auto_remove=True.
2017-12-06 12:12:26 -06:00
Erik Johnson
84c38c09ca
Add integration tests for docker_container.run state 2017-12-06 12:12:26 -06:00
Erik Johnson
64aa4fbbec
Many improvements to docker network and container states
Much Improved Support for Docker Networking
===========================================

The `docker_network.present` state has undergone a full rewrite, which
includes the following improvements:

Full API Support for Network Management
---------------------------------------

The improvements made to input handling in the
`docker_container.running` state for 2017.7.0 have now been expanded to
docker_network.present`.  This brings with it full support for all
tunable configuration arguments.

Custom Subnets
--------------

Custom subnets can now be configured. Both IPv4 and mixed IPv4/IPv6
networks are supported.

Network Configuration in :py:func:`docker_container.running` States
-------------------------------------------------------------------

It is now possible to configure static IPv4/IPv6 addresses, as well as
links and labels.

Improved Handling of Images from Custom Registries
==================================================

Rather than attempting to parse the tag from the passed image name, Salt
will now resolve that tag down to an image ID and use that ID instead.

Due to this change, there are some backward-incompatible changes to
image management. See below for a full list of these changes.

Backward-incompatible Changes to Docker Image Management
--------------------------------------------------------

Passing image names to the following functions must now be done using separate
`repository` and `tag` arguments:

- `docker.build`
- `docker.commit`
- `docker.import`
- `docker.load`
- `docker.tag`
- `docker.sls_build`

Additionally, the `tag` argument must now be explicitly passed to the
`docker_image.present` state, unless the image is being pulled from a
docker registry.
2017-12-06 12:12:25 -06:00
Erik Johnson
01a76919cb
Add hide_output option to cmd state/exec module
We have `output_loglevel` for controlling logging, but no corresponding
option to suppress the output from the command from being returned. This
adds a `hide_output` option to do that.

Additionally, this removes the rest of the references to the
long-since-deprecated `quiet` argument from the cmd execution module,
and adds a warning to states which use this argument. `quiet` appears to
have been incompletely removed following its deprecation. It was not
being passed to _check_loglevel(), so it was essentially ignored, but it
was still being accepted as an argument by several functions. Those
references to what has for some time now been a no-op argument are now
removed.
2017-12-05 16:10:02 -06:00
Michael Calmer
bbf542d5d1 pylint fixes 2017-12-04 15:38:23 +01:00
Michael Calmer
3d04f7d1fe test package capability feature 2017-12-04 15:38:22 +01: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
7536150567
Add service.running integration state test 2017-11-16 14:12:59 -05:00
Eric Radman
d921e1e6cb
Report 'onlyif' and 'unless' conditions as true or false
Elide terminology "execution failed/succeeded" since the result of these
conditions does not indicate a failure in state execution. Instead
simply report the result of each condition.
2017-10-25 11:03:13 -04:00
Nicole Thomas
f0175623ed Merge branch 'develop' into ssh_known_hosts_improvements 2017-10-19 13:44:29 -04: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
Erik Johnson
c6b655b6e9
Move 14 more functions from salt.utils
These functions are:

salt.utils.test_mode -> salt.utils.args.test_mode
salt.utils.split_input -> salt.utils.args.split_input
alt.utils.pem_finger -> salt.utils.crypt.pem_finger
salt.utils.is_bin_file -> salt.utils.files.is_binary
salt.utils.list_files -> salt.utils.files.list_files
salt.utils.safe_walk -> salt.utils.files.safe_walk
salt.utils.st_mode_to_octal -> salt.utils.files.st_mode_to_octal
salt.utils.normalize_mode -> salt.utils.files.normalize_mode
salt.utils.human_size_to_bytes -> salt.utils.files.human_size_to_bytes
salt.utils.get_hash -> salt.utils.hashutils.get_hash
salt.utils.is_list -> salt.utils.data.is_list
salt.utils.is_iter -> salt.utils.data.is_iter
salt.utils.isorted -> salt.utils.data.sorted_ignorecase
salt.utils.is_true -> salt.utils.data.is_true
2017-10-13 09:29:03 -05:00
Alexei Pope Lane
ad80801d0f Improvements to SSH known_hosts module and state. 2017-09-19 13:28:48 +10:00
Aneesh Agrawal
ba63920874 Support states returning a list for ret['comment']
Some states are complicated and multiple subparts,
or maybe cross-call into __states__ if they manage subresources.
In these cases, they will have multiple comments.
Make this more ergonomic by supporting a list of strings as the
value for ret['comment'] in state returns and documenting this.
By joining comments on newlines, it is possible to combine
single-line and multi-line comments cleanly, as opposed to e.g. commas.

The driving impetus for this is some of the boto modules.
An update to the boto_sqs module is included as an example.

Add a check that outgoing state return data has the right shape,
and add a testcase as well.
Fix the NPM state tests and the saltmod runner & wheel state functions
to comply with the prescribed format.
2017-09-05 19:52:42 +00:00
rallytime
6fad40454a Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/aptpkg.py
  - salt/utils/napalm.py
2017-08-28 09:28:41 -04:00
rallytime
d40eba6b37 Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/states/git.py
2017-08-25 16:07:27 -04:00
Daniel Wallace
ccd2241777 Pin request install to version
This fails on centos 6 because its node is too old to support the version of
hawk bumped here https://github.com/request/request/pull/2751, we can still
test the functionality.  This will pull from github, and install a specific tag
version, and we still do the uninstall using the github path.

This should be more stable.
2017-08-25 10:23:35 -06:00
Erik Johnson
2b76029ded Move 4 functions from salt.utils to salt.utils.versions
This moves the following functions from salt.utils to salt.utils.versions:

- warn_until
- kwargs_warn_until
- compare_versions (as salt.utils.versions.compare)
- version_cmp
2017-08-15 12:53:57 -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
rallytime
fb7117f2ac Use salt.utils.versions.LooseVersion instead of distutils 2017-08-11 16:31:24 -04:00
rallytime
29ff19c587 Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/config/__init__.py
  - salt/states/dockerng.py
  - salt/utils/cloud.py
2017-08-11 15:17:19 -04:00
Daniel Wallace
da3402a53d make sure cmd is not run when npm isn't installed
apparently the skipIf on the functions still get run, even if the function is
going to be skipped based on a skipIf on the class.
2017-08-11 10:58:00 -06:00
Daniel Wallace
b458b89fb8 skip cache_clean test if npm version is >= 5.0.0 2017-08-10 14:17:47 -06:00
rallytime
5d8d6225b5 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/augeas_cfg.py
  - salt/netapi/rest_cherrypy/app.py
  - salt/runners/manage.py
  - salt/states/boto_cfn.py
  - salt/utils/cloud.py
  - tests/integration/states/test_pkg.py
2017-08-10 14:47:14 -04:00
Erik Johnson
c69f17dd18 Add integration test for #42774 2017-08-08 14:20:42 -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
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
rallytime
c673b64583 Merge branch '2016.11' into '2017.7'
Conflicts:
  - doc/conf.py
  - doc/ref/configuration/master.rst
  - doc/ref/configuration/minion.rst
  - salt/engines/hipchat.py
  - salt/engines/slack.py
  - salt/grains/core.py
  - salt/version.py
  - tests/integration/states/test_renderers.py
2017-07-20 09:54:08 -06:00
rallytime
df693423b9 Move salt.utils.rm_rf to salt.utils.files.rm_rf
Also added a deprecation warning to utils/__init__.py and updated
all references to rm_rf in salt codebase.
2017-07-18 10:48:54 -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
Pablo Suárez Hernández
915d94219e Allow to check whether a function is available on the AliasesLoader wrapper 2017-07-18 12:57:36 +01:00
Gareth J. Greenaway
a34970b45b Back porting the fix for 2017.7 that ensures the order of the names parameter. 2017-07-06 12:12:50 -07:00
Erik Johnson
9a50e7c1ca Merge remote-tracking branch 'upstream/2017.7' into merge-develop 2017-06-28 22:10:50 -05:00
rallytime
7d7be2d375 Merge branch '2016.11' into '2017.7'
Conflicts:
  - doc/ref/configuration/master.rst
  - tests/integration/states/test_archive.py
  - tests/unit/transport/test_tcp.py
  - tests/unit/transport/test_zeromq.py
2017-06-28 10:48:37 -06:00
Denys Havrysh
54910fe55f archive.extracted: fix hash sum verification for local archives 2017-06-26 19:08:47 +03:00
Mike Place
b0556bd58b Merge branch 'develop' into issue3415 2017-06-15 10:09:46 -05:00
Erik Johnson
444e45b8e8 Add support for comparison operators to pkg.install (yum/dnf, apt) 2017-06-14 13:21:02 -05:00
rallytime
74d9a36d5a Merge branch 'nitrogen' into 'develop'
Conflicts:
  - pkg/salt-proxy@.service
  - salt/modules/npm.py
  - salt/modules/parted.py
  - tests/integration/modules/test_libcloud_dns.py
2017-06-13 15:01:51 -06:00
rallytime
bdf33d7f5f Merge branch '2016.11' into 'nitrogen'
No conflicts.
2017-06-13 09:26:05 -06:00
Daniel Wallace
0fa380f75c npm 5 and greater requires --force for cache clean
This is the error

```
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and
data extracted from the cache is guaranteed to be valid. If you want to make
sure everything is consistent, use 'npm cache verify' instead.

npm ERR!
npm ERR! If you're sure you want to delete the entire cache, rerun this command
with --force.
```
2017-06-12 14:48:43 -06:00
rallytime
396b06fdf8 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-06-07 09:54:20 -06:00
Mike Place
45326ccdec Merge pull request #41621 from gtmanfred/mac
Fix some mac tests
2017-06-07 10:19:25 -05:00
Daniel Wallace
b25b487ceb create home directory for issue-1959
Fixes https://github.com/saltstack/salt-jenkins/issues/388
2017-06-06 13:32:57 -06:00