Commit Graph

4384 Commits

Author SHA1 Message Date
Pablo Suarez Hernandez
63e2f27fa6 lint fix 2016-06-09 21:33:06 +01:00
rallytime
f078d57b57 Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/modules/rabbitmq.py
  - salt/modules/win_servermanager.py
  - salt/state.py
  - salt/states/boto_s3_bucket.py
  - salt/states/pip_state.py
  - salt/states/win_servermanager.py
  - tests/unit/modules/win_servermanager_test.py
  - tests/unit/states/dockerng_test.py
2016-06-09 13:06:10 -06:00
Nicole Thomas
08a584b3e5 Merge pull request #33711 from rallytime/merge-develop-3
[develop] Merge forward from 2016.3 to develop
2016-06-09 14:12:48 -04:00
Pablo Suarez Hernandez
7f7800ffc9 testing if SUSE os grain is set from /etc/os-release 2016-06-09 15:09:00 +01:00
Justin Findlay
82f95429db modules.random_org unit tests: skip if random.org down 2016-06-08 20:46:20 -06:00
rallytime
595d4f2ac3 Fixup new groupadd tests for syntax change in 2016.3 2016-06-08 12:42:52 -06:00
rallytime
c5b4ec0b0f Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/cli/salt.py
  - salt/modules/groupadd.py
  - salt/states/service.py
2016-06-08 11:20:18 -06:00
Mike Place
01aaf3e2a9 Merge pull request #33771 from twangboy/win_dism
Additional functionality to win_dism.py
2016-06-08 06:58:20 -07:00
Mike Place
f7b3d0eda0 Merge pull request #33839 from cachedout/fix_pkgresource_test_stacktrace
Fix another unit test stacktrace in pkg_resource
2016-06-08 06:32:55 -07:00
Mike Place
5f081ef31c Merge pull request #33840 from cachedout/remove_matcher_unit_tests
Remove matcher tests
2016-06-08 06:31:41 -07:00
Nicolas Delaby
0d40e1c4f3 Add support for edge case when Cmd and Entrypoint can't be blanked 2016-06-08 10:46:24 +02:00
Mike Place
6297448377 Remove matcher tests
These all assert directly against mock objects. They're pointless.
2016-06-07 16:36:01 -06:00
Mike Place
435547a747 Fix another unit test stacktrace in pkg_resource 2016-06-07 15:55:52 -06:00
Mike Place
453fb1ac91 Fixing more stupid unit tests
This time win_servermanager
2016-06-07 15:33:12 -06:00
twangboy
9be45fe37a Fix some more lint 2016-06-07 13:17:29 -06:00
twangboy
421dc97957 Fix/add unit tests for state 2016-06-07 12:52:01 -06:00
twangboy
8d66fac74c Add missing unit tests 2016-06-07 09:53:22 -06:00
twangboy
60f856f73d Fix unit tests for module 2016-06-06 18:33:29 -06:00
Mike Place
db3cc8dcee Merge pull request #33779 from bodhi-space/develop
INFRA-1594 - Add various S3 functions needed for optionally emptying …
2016-06-06 14:52:07 -07:00
Tom Williams
102d696460 INFRA-1594 - fix up unit tests 2016-06-06 14:37:38 -04:00
Jeffrey 'jf' Lim
ffa788fd67 Fix minor typo in test name in tests/unit/states/dockerng_test.py 2016-06-07 01:11:30 +08:00
Justin Findlay
90aee79c39 states.service.mod_watch: update unit test 2016-06-06 10:54:16 -06:00
Dan Slimmon
f87bc347fd Fixed ACL user comparison. Resolves #33754. 2016-06-04 15:14:00 +00:00
Mike Place
a5684ed123 Merge pull request #33670 from rallytime/fix-33605
Handle non-ascii package names in state.format_log
2016-06-03 09:16:52 -07:00
Mike Place
11e39e7203 Merge pull request #33712 from meaksh/fix-for-groupadd-module-failures-in-SLE11-2015.8
Fix for groupadd execution module failures in SLES11 systems
2016-06-03 09:13:06 -07:00
C. R. Oldham
35bc42410f Merge pull request #33705 from alexbleotu/json_schema_extension-gh
JSON Schema Extension
2016-06-03 08:42:18 -06:00
Alexandru Bleotu
d69ce3a84f JSON Schema Extension
- added support for JSON schemas that validate complex JSON objects
  (JSON objects that have as attributes other JSON objects)
2016-06-03 14:03:26 +01:00
Pablo Suárez Hernández
ab738416ba pylint fix 2016-06-03 13:57:13 +01:00
Pablo Suárez Hernández
bf27e5d36e test_members cleanup 2016-06-03 13:25:05 +01:00
Pablo Suárez Hernández
ba815dbf76 improvements on groupadd unit tests 2016-06-03 13:17:13 +01:00
Justin Findlay
87e018af2a states.test.configurable_test_state: add unit tests 2016-06-02 17:20:36 -06:00
rallytime
59bd51f4c8 Update test to correct iteration 2016-06-02 14:32:21 -04:00
Mike Place
64c7dd7032 Merge pull request #33626 from evonzee/feature/issue-15749
Feature/issue 15749
2016-06-02 11:23:36 -07:00
Dmitry Kuzmenko
66bd75cd3b New schedule tests and fixes 2016-06-02 17:14:50 +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
rallytime
b7accb0b3b Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/utils/aws.py
  - salt/utils/s3.py
2016-06-02 10:01:43 -04:00
rallytime
a580d1c6e0 Add unit test for format_log change 2016-06-02 09:26:39 -04:00
twangboy
6c7b21676a Fix lint and tests 2016-06-01 17:10:55 -06:00
Mike Place
5e022ff29c Merge pull request #33581 from dincamihai/2015.8
Call zypper refresh after adding/modifying a repository
2016-06-01 15:25:11 -07:00
Pablo Suárez Hernández
f9b6858cf9 unit tests for udev execution module
tests improvements
2016-06-01 12:23:30 +01:00
rallytime
cd05d2bed1 Fix zypper test 2016-05-31 13:43:09 -04:00
Mike Place
9ed809f557 Merge pull request #33610 from tonybaloney/servicenow_fix
Change the ServiceNow module's non_structured_query method to support kwargs
2016-05-31 09:23:18 -07:00
Nicole Thomas
74a7b78e00 Merge branch '2015.8' into '2016.3'
Conflicts:
  -   -   -   -   -   -   -   -   - doc/conf.py
2016-05-31 11:02:20 -04:00
eric vz
c4f9de2d24 fix broken pacman module tests 2016-05-31 08:17:33 -05:00
eric vz
b49f9d5a19 one last, sad piece of lint 2016-05-31 01:03:15 -05:00
eric vz
7e0f1c0841 Fix (hopefully) the last linter issues 2016-05-31 00:34:13 -05:00
eric vz
803f219160 Clean up linter warnings 2016-05-31 00:07:31 -05:00
eric vz
bf25b8118e switch pacman.group_info to return an array instead of a set so it's useful on command line 2016-05-30 23:08:59 -05:00
eric vz
94c6378c6e Implement group_diff for pacman 2016-05-30 16:56:53 -05:00
eric vz
e89a43d1d0 Implement a basic group_info 2016-05-30 16:39:16 -05:00
eric vz
fa2fe986e6 Add pacman group_list and unit test 2016-05-30 15:33:59 -05:00
eric vz
595beadda7 formatting 2016-05-30 14:13:56 -05:00
eric vz
9e6013c4b7 move helper into a lambda 2016-05-30 14:13:36 -05:00
eric vz
0179d4d849 Add unit tests for pacman list packages 2016-05-30 09:37:17 -05:00
Mihai Dinca
788730ea72 DRY test 2016-05-30 13:52:46 +02:00
Mihai Dinca
1d3769ccfa Improve zypper_patcher_config looks 2016-05-30 13:52:45 +02:00
Mihai Dinca
42d8d4195c Assert only gpgautoimport: True works 2016-05-30 13:51:54 +02:00
Mihai Dinca
80bfbe5c52 Reduce dicts and lists to one line where possible 2016-05-30 10:47:41 +02:00
Mihai Dinca
1d5d6d7d60 Update test method names to pass pylint 2016-05-30 10:05:07 +02:00
Dan Slimmon
180099ae9f Wrote test for broken server connection 2016-05-30 03:23:18 +00:00
anthony-shaw
83461e0940
fixes for docs in servicenow module and more tests 2016-05-29 21:03:33 +10:00
twangboy
79bc7195dc Fix unit tests 2016-05-27 11:33:52 -06:00
Mihai Dinca
c7ae5907ee Call zypper refresh after adding/modifying a repository
Calling `zypper --gpg-auto-import-keys refresh` is required after
adding/modifying a repository because `--gpg-auto-import-keys` doesn't
do anything when called with `zypper ar` or `zypper mr`.
Without calling `zypper --gpg-auto-import-keys refresh` here, calling
`zypper ref` after adding/removing would still ask for
accepting/rejecting the gpg key.
2016-05-27 16:17:10 +02:00
Mike Place
d052908729 Merge pull request #33501 from meaksh/zypper-download-check-signature-2015.8
unit tests for rpm.checksum() and zypper.download()
2016-05-26 07:34:27 -07:00
Pablo Suárez Hernández
eaaef25c79 lint issue fixed 2016-05-26 08:26:24 +01:00
Justin Findlay
2781377b17 modules.mac_brew: update unit tests 2016-05-25 22:15:12 -06:00
anthony-shaw
8885a8250e fix clrf 2016-05-26 08:32:28 +10:00
anthony-shaw
805c12b392 add a test to check existing functionality is broken 2016-05-26 08:31:17 +10:00
rallytime
a5e0141eda Merge branch '2015.8' into '2106.3'
Conflicts:
  - salt/beacons/__init__.py
  - salt/modules/saltutil.py
  - salt/modules/zypper.py
  - salt/states/grains.py
  - salt/states/pkgrepo.py
  - salt/states/service.py
2016-05-25 13:44:21 -06:00
Stefan Schweer
a6c9f2b120 added missing whitespaces 2016-05-25 19:56:00 +02:00
Pablo Suárez Hernández
6b6febb211 unit tests for rpm.checksum() and zypper.download() 2016-05-25 17:08:16 +01:00
Stefan Schweer
169dec76b7 improved tests 2016-05-25 10:23:14 +02:00
Stefan Schweer
f84740957a rebased on develop 2016-05-25 10:22:10 +02:00
Blaine Chatman
7599b18995 fix jobs.list_jobs failing with search_target 2016-05-24 17:56:45 -07:00
Mihai Dincă
c8b4f338d8 Make --gpg-auto-import-keys a global param when calling zypper (#33432) 2016-05-23 14:15:29 -07:00
Mike Place
a4abcc3d03 Remove rabbitmq unit tests (#33451)
* Remove completely pointless RabbitMQ unit test

Why would we even write tests to check to see if a mocked object
returns a string and then assert against that string?! This is absurd.

* Spurious print
2016-05-23 13:57:22 -07:00
Nicole Thomas
336fbb03bc [develop] Merge forward from 2016.3 to develop (#33408)
* Fix master hanging after a request from minion with removed key. (#33333)

* ZMQ monitor for MWorker connections.

* Reauth minion if the key was removed on the master side.

* Allow concurrency mode in state runs if using sudo (#33325)

Closes #30130

* Disambiguate non-exact matches when checking if sysv service is enabled (#33324)

Fixes #33323

* remove redundant, incorrect sudo_runas config documentation (#33318)

* remove sudo_runas documentation

`sudo_runas` was renamed to `sudo_user` and the documentation was not
updated accordingly.

* conf/minion: update sudo_user description

The description from sudo_runas was better.

* import ps from psutil_compat in beacons (#33334)

* beacons.network_info: import gate psutil

* beacons.ps: import gate psutil

* Add docs for mine_functions config var (#33326)

* Add docs for mine_functions config var

* Note that mine_enabled essentially just doesn't add the mine
update function to the scheduler.

* Bp 28467 calm mine (#33327)

* make minion mine update behavior more configurable

* Add docs for mine_functions config var

* Remove config dup from mine config options

Refs #28467

* 2015.8 does not have _DFLT_MULTIPROCESSING_MODE

* This won't be in until 2015.8.10.

* Fix network.managed for windows (#33312)

* Fix some link errors in the test writing tutorial (#33347)

* Describes parameters in register_instances function (#33339)

* Fix UnboundLocalError in git.latest (#33340)

Resolves #32260.

* Expanded documentation for boto_elb state and module (#33341)

* Describes what happens when the CNAME parameter is given.

* Describes what the recognized attributes are for for ELBs.

* Properly detect newer Linux Mint distros (#33359)

* Properly detect newer Linux Mint distros

LMDE 2 and Linux Mint 17.3 changed the DISTRIB_ID in /etc/lsb-release to
``LinuxMint``, breaking OS detection for these distros.

This commit fixes that by adding an entry to the OS_NAME_MAP in the core
grains.

* Remove LinuxMint os_family from aptpkg.py

It is no longer necessary as the distro is now detected properly, which
will lead to an os_family of Debian.

* Update job_cache and keep_jobs docs to be more specific to their behavior (#33328)

* Update job_cache and keep_jobs docs to be more specific to their behavior

Also fixed a bug discovered when investigating job_cache/keep_jobs functionality
where the jid directory and files were removed by the cache cleaner, but not the
original jid clash detection directory created in /var/cache/salt/master/jobs/.

Fixes #29286

* Add testcase for the changes in the local_cache.clean_old_jobs func

* Mark tests as destructive

* Put destructive test decorator in correct location

* Remove mentions of windows not supporting pkgs param (#33361)

Fixes #33313

* Updates docs version to 2015.8.9
Adds note regarding the os grain on Mint Linux
Adds an FAQ regarding grains that change due to upstream changes

* revved 2015.8 branch to .9 in version selector

* Add initscripts, SystemD service units and environment files for Debian (#32857)

* Add note to docs about api settings for Hipchat API v2 (#33365)

Fixes #27779

* Add win_pkg to list of modules that support "version" in pkg.installed (#33362)

Fixes #32913

* Add note about name parameter in git_pillar docs (#33369)

Fixes #27737

* Better YAML syntax error handling (#33375)

Closes #26574

* Improve doc clarity for disable_modules documentation (#33379)

* Improve doc clarity for disable_modules documentation

* Additional clarification on blacklisted name

* maintain the fallabck because I am totally sick of this crap

* blast, put the try/except int he right place

* restore whitespace

* Fix traceback in logging for config validation (#33386)

* 2015.8.10 release notes

* Sync pillarstack to latest upstream version (#33391)

* Don't lay down all available opts (#33385)

* Don't lay down all available opts

* We need at least one opt in there

* Condense defaults

* Put the default hash type back
2016-05-20 13:48:40 -07:00
Dmitry Kuzmenko
17b03e9d8b Allow to blacklist/whitelist renderers. (#33358)
* Allow to blacklist/whitelist renderers.

* Fix tests.

* Unit test for renderer blacklisting.

* Minor tests fixes
2016-05-20 10:41:51 -07:00
rallytime
35ad788470 Merge branch '2015.8' into '2016.3'
Conflicts:
  - conf/minion
  - doc/ref/configuration/minion.rst
  - salt/modules/boto_elb.py
  - salt/modules/sudo.py
  - salt/states/boto_elb.py
  - salt/transport/zeromq.py
2016-05-19 16:22:36 -06:00
Erik Johnson
8b3497b129 Catch exception raised from invalid verify_options (#33317)
* Catch exception raised from invalid verify_options

This fails the state gracefully in these cases.

Refs: 6b97161293 (r63577507)

* Raise an exception when package verification fails

* Catch failed package verification commands

Also, since pkg.verify is run separately on each targeted package, don't
add errors for each failure, just add one error to what we report.

* Update rpm test_verify test to reflect change from cmd.run to cmd.run_all
2016-05-19 12:13:30 -06:00
Andreas Lutro
8abf303183 Add support for kapacitor 0.13 (#33352)
* add support for kapacitor 0.13

* update kapacitor tests
2016-05-19 11:03:03 -07:00
Nicole Thomas
4fdb097c01 Update job_cache and keep_jobs docs to be more specific to their behavior (#33328)
* Update job_cache and keep_jobs docs to be more specific to their behavior

Also fixed a bug discovered when investigating job_cache/keep_jobs functionality
where the jid directory and files were removed by the cache cleaner, but not the
original jid clash detection directory created in /var/cache/salt/master/jobs/.

Fixes #29286

* Add testcase for the changes in the local_cache.clean_old_jobs func

* Mark tests as destructive

* Put destructive test decorator in correct location
2016-05-19 09:32:32 -07:00
Nicole Thomas
7a7018261e Server Density agentv2 support (#32772) (#33303)
* Added support for the agentv2

* Updated os field to match the SD API requirement

* filename is an absolute path on official installations

* Install script URL uses a redirect now, so we should instruct curl to follow them

* Added a missing import

* Updated the settings for the v2 agent

* Fixed pep8 issues

* select v2 agent for the test
2016-05-17 09:50:36 -07:00
Nicole Thomas
8d805e6595 Lint #32985 (#33278)
* Fix context clash.

boto_vpc uses both boto and boto3. Both utils for those use the same name for their connection context. If you used states that required both boto and boto3, the get_conn would return the object.

* Add a unit test to the boto context conflict problem

* Fix pylint errors and ensure new test to runs correctly

Merges #32985

* Fix typo
2016-05-16 15:02:05 -06:00
rallytime
c8b8d82745 Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/proxy/junos.py
2016-05-16 12:32:23 -06:00
rallytime
32779b8d71 Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/modules/x509.py
2016-05-16 10:47:12 -06:00
Őry, Máté
0de5410d18 postgres.db_create: fix handling of empty string (#33261)
* modules.postgres: fix handling of empty string in db_create

The code responsible for collecting the parameters used in the CREATE
DATABASE query works unexpectedly in case for values which are evaluated
to False as bool, but are not None.

This caused queries with missing rvalues like this one (lc_collate=""):
2016-05-13 16:04:05,243 [salt.loaded.int.module.cmdmod][ERROR   ][2990]
stderr: ERROR:  syntax error at or near "OWNER"
LINE 1: ..._production" WITH ENCODING = 'utf8' LC_COLLATE =  OWNER =
"g...

Please note that proper escaping or a different approach would be needed
here.

* modules.postgres: handle trivial sqli in db_create

* modules.postgres: fix OrderedDict usage

* modules.postgres: quote TABLESPACE too in db_create
2016-05-16 09:27:40 -07:00
Moe
3b50a7b98d Fix list_values, add test (#33264) 2016-05-16 07:31:19 -07:00
rattlesnack
05e763c53c Gentoo/OpenRC service management enhancements (#33260)
* gentoo service enhancements

* fixing command examples
making sure enabled handles multiple runlevel

* unused import removed

* replacing collection.OrderedDict with salt.utils.odict.OrderedDict

* set replaced with list
2016-05-16 07:26:24 -07:00
Erik Johnson
855bed36c1 Check rendered YAML for invalid keys (#33213)
* Check rendered YAML for invalid keys

PyYAML will for some reason allow improper YAML, specifically double
curly-braces like ``{{ }}``, to be formed into an unhashable dict (that
is, one with a dict as a key). This commit will change the YAML renderer
such that the rendered data is recursively checked for keys that are
dicts, and raises an SaltRenderError if such a key is encountered.

Resolves #33073.

* Fix smtp returner test

This test was using jinja placeholders but was not passing the template
through the jinja renderer. This commit adds the use of the jinja
renderer to this test to fix the failure caused by the addition of
verification of the loaded YAML inthe previous commit.
2016-05-13 09:22:43 -07:00
Andrew Hammond
bc8f010489 add nodegroups ext_pillar (#33179)
* add nodegroups ext_pillar

* nodegroups ext_pillar documentation tweaks

* put name in AUTHORS rather than directly in module
2016-05-13 08:26:13 -06:00
Justin Anderson
012dc882aa Fix boto_vpc_test to work with #32677 (#33214) 2016-05-13 08:22:10 -06:00
Nicole Thomas
457d9dd4f5 [develop] Merge forward from 2016.3 to develop (#33193)
* Add run_on_start docs to schedule.rst (#32958)

Fixes #22580

* Backport #33021 manually to 2015.5 (#33044)

* Saltfile with pillar tests (#33045)

* add file.managed with pillar data tests

* do not require git for other tests

* Fix minor document error of test.assertion (#33067)

* test pillar.items output (#33060)

* File and User test fixes for 2015.5 on Fedora23 (#33055)

* Fix file_test.test_symlink on 2015.5

* Fix failing user present test

* add test for installing package while using salt-call --local (#33025)

* add test for installing package while using salt-call --local

* fix pylint

* ssh docs: install py-2.6 for RHEL 5

* Bugfix: Restore boolean values from the repo configuration

* Add test data for repos

* Add repo config test

* Bugfix (follow-up): setting priority requires non-positive integer

* modules.npm: do not log npm --version at info level (#33084)

* salt-cloud: fix ipv6-only virtual machines (#32865)

* salt-cloud: fix ipv6-only virtual machines

* fix hostname for rsync fallback in scp_file function

* use 4 spaces instead of 2

* remove global variable, use direct socket call instead

* Use saltstack repo in buildpackage.py on CentOS 5 (#33080)

* Lower display of msgpack failure msg to debug (#33078)

Closes #33074

* cloud.query needs to define mapper.opts (#33098)

* clarify docs that map is designed to be run once. is not stateful (#33102)

* Moved _finger_fail method to parent class.

Method _finger_fail method from SAuth to AsyncAuth class to make method available
in both class and fix an issue where _finger_Fail is called inside AsyncAuth.

* Fix 33058 (#33099)

* Fix servermanager module

- Added check for 2008 version of windows
- Added Import-Module ServerManager to _pshell_json.
  Apparently this needs to run each time we issue a
  servermanager command.

* Fix list_available

* salt.utils.gitfs: fix formatting for warning messages (#33064)

* salt.utils.gitfs: fix formatting for warning messages

When git_pillar support was added to salt.utils.gitfs, the
recommendation globals had string formatting placeholders added to them,
but the locations where these values are referenced do not call
``.format()`` to properly replace them. This commit fixes that
oversight.

* Remove more gitfs and master-specific wording from log messages

* Add a check that the cmdline of the found proc matches (#33129)

* Doc mock decorators (#33132)

* Add mock function for mocking decorators

* Mock the stdlib user module because importing it will open the repl

* Fix broken parsing of usermgmt.conf on OpenBSD (#33135)

When creating a new user, if a group of the same name already exists,
the usermgmt.conf file is consulted to determine the primary group.
It's in these cases that the parsing bug is triggered.

This code change addresses several of the existing issues:

- The previous split statement explicitly specified a single space.
  Since a config line may have any number of spaces and/or tabs
  surrounding the entries, the resulting array's elements may be
  incorrect.

- According to the man pages for usermgmt.conf, the "group" config
  entry accpets a single parameter -- so we shouldn't iterate.

- The "val[1]" was returning the 2nd letter of each word and not the
  second word on the config line as intended.

* Move salt-ssh thin dir location to /var/tmp (#33130)

* Move salt-ssh thin dir location to /var/tmp

Closes #32771

* Remove performance penelty language

* If cache_jobs: True is set, populate the local job cache when running salt-call (#33100)

* If cache_jobs: True is set, populate the local job cache

Fixes #32834

Allows a masterless minion to query the job cache.

* Refactor cache_jobs functionality to be DRY

* Skipping salt-call --local test

* Back-port #31769 to 2015.8 (#33139)

* Handle empty acl_name in linux_acl state

Calls to setfacl interpret an empty group or user name to mean to be the
owner of the file they're operating on. For example, for a directory
owned by group 'admin', the ACL 'default:group::rwx' is equivalent to
'default:group:admin:rwx'.

The output of the getfacl execution module returns ACLs in the format of
'group:admin:rwx' instead of 'group::rwx'. This commit changes the
acl.present state to look for the owner of the file if the acl_name
paremeter is empty.

* Fix acl.present/acl.absent changing default ACLs

The behaviour of the acl.present and acl.absent is to check the data
structure returned by getfacl contains a key by the name of acl_type.

However, this data structure does not contain any default ACLs if none
exist, so this check will fail. We omit the check if a default ACL was
passed into the state functions.

Unfortunately, the call to modfacl may fail if the user passes in an
acl_type such as 'default:random'. In this case the state will appear to
succeed, but do nothing.

This fixes the state module to allow setting default ACLs on files which
have none.

* Fix regression in 2016.3 HEAD when version is specified (#33146)

Resolves #33013.

* Hash fileclients by opts (#33142)

* Hash fileclients by opts

There was an issue whereby the cache of the fileclient was being overwritten
by dueling minion instances in multimaster mode. This protects them by hashing
by the id of opts.

Closes #25040

* Silly typo!

* Remove tests which do not test any actual functionality or are too tightly coupled to the implementation

* Strip ldap fqdn (#33127)

* Add option to strip off domain names on computer names that come from LDAP/AD

* Add strip_domains option for ldap.

* Add documentation for auth.ldap.minion_stripdomains.

* [2015.5] Update to latest bootstrap script v2016.05.10 (#33155)

* [2015.8] Update to latest bootstrap script v2016.05.10 (#33156)

* [2016.3] Update to latest bootstrap script v2016.05.10 (#33157)

* add 2015.5.11 release notes (#33160)

* add 2015.8.9 release notes (#33161)

* Pip fix (#33180)

* fix pip!!

* make it work with old pip as well

* Added resiliency

* Don't need to check, just get the right name

* [2015.5] Update to latest bootstrap script v2016.05.11 (#33185)
2016-05-12 07:53:39 -07:00
rallytime
c6f18fac3f Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/minion.py
2016-05-10 15:13:24 -06:00
Mike Place
033bef2ed2 Hash fileclients by opts (#33142)
* Hash fileclients by opts

There was an issue whereby the cache of the fileclient was being overwritten
by dueling minion instances in multimaster mode. This protects them by hashing
by the id of opts.

Closes #25040

* Silly typo!

* Remove tests which do not test any actual functionality or are too tightly coupled to the implementation
2016-05-10 15:04:52 -06:00
rallytime
92e0c17645 Merge branch '2015.8' into '2016.3'
No conflicts.
2016-05-09 13:55:06 -06:00
Nicole Thomas
b6cf601722 Merge pull request #33103 from rallytime/merge-develop
[develop] Merge forward from 2016.3 to develop
2016-05-09 13:24:25 -06:00
rallytime
f2dec459d8 Take the develop version of glusterfs.py state 2016-05-09 11:17:46 -06:00
Mike Place
3690598301 Remove poorly written test (#33124)
This tests nothing at all. Removing with extreme prejudice.
2016-05-09 10:06:18 -07:00
rallytime
ced033c0a4 Merge branch '2016.3' into 'develop'
Conflicts:
  - doc/topics/releases/2016.3.0.rst
  - salt/scripts.py
  - salt/states/glusterfs.py
2016-05-06 16:05:58 -06:00
rallytime
180c03ca24 Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/cli/salt.py
  - salt/modules/zypper.py
  - salt/scripts.py
  - salt/states/boto_elb.py
  - tests/integration/states/user.py
  - tests/unit/states/file_test.py
2016-05-06 09:20:05 -06:00
Mike Place
6d604926d3 Merge pull request #33088 from isbm/isbm-zypper-fix-booleans
Bugfix: Restore boolean values from the repo configuration
2016-05-06 08:13:27 -07:00
Megan Wilhite
2c6326f14a fix tests for file.blockplace to remove newline (#33082) 2016-05-06 08:44:20 -06:00
Bo Maryniuk
79a46e091c Add repo config test 2016-05-06 12:57:52 +02:00
Bo Maryniuk
222b8369ca Add test data for repos 2016-05-06 12:57:36 +02:00
Mike Place
fb89877cf2 Merge pull request #32892 from isbm/isbm-zypper-env-variables
Resolve Zypper locks on asynchronous calls
2016-05-05 07:34:59 -07:00
Andrew Hammond
dd20299087 Refactor ipset tests (#32973)
* remove spurious return

* refactor state.ipset tests

* ipset comments: consistency and correct english

* trim out broken code
2016-05-05 07:31:49 -07:00
Kevin Quinn
581f9d328a Fix 'present' option when used without 'key_type' (#32965) 2016-05-05 07:27:30 -07:00
Shane Lee
280d10af01 rewrite win_service.py (#32998)
* Rewrite service.get_all

* Add service.info

* Add try/except for service not found

* Simplify raise error

* Add lookup dicts for service.info

* Fix lookup dictionaries

* Add Description to service.info

* Add additional status details

* Add service.modify function

* Fix _get_service_handles function

* Fix modify function, transition others

* Modified enable, disable, enabled, and disabled

* Fix service.disable

* Add documentation

* Find mismatched case service names

* Fix some lint

* Fix unit tests

* Fix lint in win_service_test

* Skip tests that will fail when WINAPI not available
2016-05-05 07:20:55 -07:00
Justin Anderson
1066063a19 File and User test fixes for 2015.8 on Fedora23 (#33056)
* Fix failing user present test

* Fix file_test.test_symlink failure on 2015.8
2016-05-05 07:05:10 -07:00
Justin Anderson
6d3e4e8935 File and User test fixes for 2015.5 on Fedora23 (#33055)
* Fix file_test.test_symlink on 2015.5

* Fix failing user present test
2016-05-05 07:00:59 -07:00
Justin Findlay
a78bbd0544 Update mac_assistive module for El Capitan (10.11) (#33047)
* modules.mac_assistive int tests: wrap args in list

* modules.mac_assistive.install: match schema on El Capitan

* modules.mac_assistive: remove redundant LooseVersion

* modules.mac_assistive unit tests: mock __grains__
2016-05-04 15:34:03 -06:00
Justin Findlay
186352a8b8 fix dimensiondata, gce unit test certs on MacOS (#33020) 2016-05-04 09:09:02 -07:00
Justin Anderson
28ba98c613 Skip some tests related to #32902 (#32995) 2016-05-03 08:55:23 -07:00
rallytime
16c9ce70ad Merge branch '2016.3' into 'develop'
No conflicts.
2016-05-02 12:58:24 -06:00
rallytime
c12b9a5094 Merge branch '2015.8' into '2016.3'
No conflicts.
2016-05-02 10:50:27 -06:00
Justin Anderson
00fbeaba5f Fix boto_secgroup_test (#32986) 2016-05-02 10:46:19 -06:00
Anthony Shaw
af7593ae53 Introduce a lightweight unit test runner for execution modules (#32792)
* Added servicenow execution module

* Fixed up the linting

* Fix docstrings

* Setup basic unit test runner

* Setup basic loader mock and wrapper for declaring dependent packages

* Updated unit test runner and setup my first test example

* Update the servicenow module after a bad merge commit

* Code comments for the base unit test runners

* Fix linting issues

* remove empty line endings
2016-04-29 13:36:17 -07:00
Justin Findlay
cc854f1464 update pip state and integration tests for newer pip versions (#32905)
* modules.virtualenv_mod: use correct pip bootstrap url

* modules.pip: raise error on mirrors arg

* states.pip: run mirrors test on < 7.0.0

* update pip integration test states to not use mirrors

* modules.pip: run mirrors tests on pip < 7.0.0
2016-04-29 10:49:29 -07:00
Nicolas Delaby
87b70186c3 When move a function to a new namespace, allow to keep original context. (#32943) 2016-04-29 10:48:20 -07:00
rallytime
5952e3e300 Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/modules/mac_brew.py
  - salt/states/archive.py
2016-04-28 15:35:34 -06:00
Justin Anderson
fa7e32afcc Fixing failures in gce_test and dimensiondata_test (#32921)
* Fixing failures in gce_test and dimensiondata_test

* Fixed lint
2016-04-28 14:15:22 -06:00
Bo Maryniuk
c55b0fab58 Test DOM parsing 2016-04-27 15:43:35 +02:00
Bo Maryniuk
c54e928e4f Add exception handling test 2016-04-27 15:43:17 +02:00
Bo Maryniuk
6a98f523ac Add Zypper caller test suite 2016-04-27 15:21:00 +02:00
Bo Maryniuk
7e1712dd80 Fix tests according to the new calling model 2016-04-27 14:35:22 +02:00
Bo Maryniuk
3a30b7fbcd Remove an obsolete test case 2016-04-27 14:34:54 +02:00
Bo Maryniuk
6e5877a2ee Add Zypper Call mock 2016-04-27 14:34:31 +02:00
rallytime
cbf42a8407 Merge branch '2016.3' into 'develop'
Conflicts:
  - conf/master
  - doc/ref/configuration/master.rst
  - salt/cli/batch.py
  - salt/cli/daemons.py
  - salt/config/__init__.py
  - salt/minion.py
  - salt/modules/aptpkg.py
  - salt/modules/beacons.py
  - salt/states/archive.py
  - salt/states/cmd.py
  - salt/utils/gitfs.py
  - tests/unit/states/cmd_test.py
2016-04-26 14:42:26 -06:00
rallytime
80fcdfb9d8 Merge branch '2015.8' into '2016.3'
Conflicts:
  - doc/topics/targeting/grains.rst
  - salt/cli/daemons.py
  - salt/exceptions.py
  - salt/minion.py
  - salt/modules/schedule.py
  - salt/scripts.py
  - salt/states/archive.py
2016-04-26 12:07:42 -06:00
Nicole Thomas
02c681311f Merge pull request #32844 from rallytime/merge-2015.8
[2015.8] Merge forward from 2015.5 to 2015.8
2016-04-26 11:38:08 -06:00
Damon Atkins
cf4826aad4 Windows Registry Unicode Support and PY2 character encoding (module.reg) (#32835)
* reg.py
* Start at PY3 support, however not tested against PY3
* Change to Unicode including from __future__ import unicode_literals
* If PY2 converts all parameter input unicode to local encoding i.e. Unicode to String
* If PY3 stays as Unicode as PY3 uses Windows Wide Char
* Supports non-asiic characters i.e. > 126
* All output is Unicode, before most of it was Unicode output
* Added a safty check to recursive delete to try and prevent a mistake like removing all of SOFTWARE
* Fixed all the pylint errors
* add _ prefix to internal functions
* Provided unit test see reg_win_test.py
reg_win_test.py
* All tests currently make real changes to the registry
* All changes are performed under SOFTWARE\SaltStackTest under HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER
* Their is still room for more tests to be developed
* Test target the new Unicode features of reg.py e.g. Copyright, Tradmark and Register characters
* General the values set in the registy contain date/time and then checked that they are the current date/time to make sure they are not left over from old tests

* Update test unit to only run the tests on windows.
Removed some code which was commented out which is not required

* chmod 644 tests/unit/modules/reg_win_test.py
2016-04-26 11:07:04 -06:00
Nicole Thomas
eb8fb6b9df Back-port #31139 to 2015.8 (#32868)
* Evaluate %h and %u before deciding if the ssh config path is absolute

Since %h is the user's home directory, it's not very useful unless it
appears at the beginning of the path.  However, putting it at the
beginning of the path does not have the expected effect: %h/.ssh
will become /home/someuser/home/someuser/.ssh, since "%h/.ssh" is
identified by Python as a non-absolute path, causing the user's
home directory to be tacked on the front.

* Improved ssh_auth path expansion test
2016-04-26 10:44:01 -06:00
rallytime
1fc9de1d04 Add 'file.source_list' mock to archive state unit tests 2016-04-26 10:39:43 -06:00
rallytime
9064d3bbfb Merge branch '2015.5' into '2015.8'
Conflicts:
  - salt/cloud/clouds/vmware.py
  - salt/modules/file.py
  - salt/states/archive.py
2016-04-25 15:45:17 -06:00
Nicole Thomas
f9ffcb697a [2016.3] Merge forward from 2015.8 to 2016.3 (#32784)
* json encode arguments passed to an execution module function call

this fixes problems where you could pass a string to a module function,
which thanks to the yaml decoder which is used when parsing command line
arguments could change its type entirely. for example:

__salt__['test.echo')('{foo: bar}')

the test.echo function just returns the argument it's given. however,
because it's being called through a salt-call process like this:

salt-call --local test.echo {foo: bar}

salt thinks it's yaml and therefore yaml decodes it. the return value
from the test.echo call above is therefore a dict, not a string.

* Prevent crash if pygit2 package is requesting re-compilation of the e… (#32652)

* Prevent crash if pygit2 package is requesting re-compilation of the entire library on production systems (no *devel packages)

* Fix PEP8: move imports to the top of the file

* Move logger up

* Add log error message in case if exception is not an ImportError

* align OS grains from older SLES with current one (#32649)

* Fixing critical bug to remove only the specified Host instead of the entire Host cluster (#32640)

* yumpkg: Ignore epoch in version comparison for explict versions without an epoch (#32563)

* yumpkg: Ignore epoch in version comparison for explict versions without an epoch

Also properly handle comparisions for packages with multiple versions.

Resolves #32229

* Don't attempt downgrade for kernel and its subpackages

Multiple versions are supported since their paths do not conflict.

* Lower log level for pillar cache (#32655)

This shouldn't show up on salt-call runs

* Don't access deprecated Exception.message attribute. (#32556)

* Don't access deprecated Exception.message attribute.

To avoid a deprecation warning message in logs.
There is a new function salt.exceptions.get_error_message(e) instead.

* Fixed module docs test.

* Fix for issue 32523 (#32672)

* Fix routes for redhat < 6

* Handle a couple of arguments better (Azure) (#32683)

* backporting a fix from develop where the use of splay would result in seconds=0 in the schedule.list when there was no seconds specified in the origina schedule

* Handle when beacon not configured and we try to enable/disable them (#32692)

* Handle the situation when the beacon is not configured and we try to disable it

* a couple more missing returns in the enable & disable

* Check dependencies type before appling str operations (#32693)

* Update external auth documentation to list supported matcher. (#32733)

Thanks to #31598, all matchers are supported for eauth configuration.
But we still have no way to use compound matchers in eauth configuration.
Update the documentation to explicitly express this limitation.

* modules.win_dacl: consistent case of dacl constants (#32720)

* Document pillar cache options (#32643)

* Add note about Pillar data cache requirement for Pillar targeting method

* Add `saltutil.refresh_pillar` function to the scheduled Minion jobs

* Minor fixes in docs

* Add note about relations between `pillar_cache` option and Pillar Targeting
to Master config comments with small reformatting

* Document Pillar Cache Options for Salt Master

* Document Minions Targeting with Mine

* Remove `saltutil.refresh_pillar` scheduled persistent job

* Properly handle minion failback failure. (#32749)

* Properly handle minion failback failure.

Initiate minion restart if all masters down on __master_disconnect like
minion does on the initial master connect on start.

* Fixed unit test

* Improve documentation on pygit2 versions (#32779)

This adds an explanation of the python-cffi dep added in pygit2 0.21.0,
and recommends 0.20.3 for LTS distros. It also links to the salt-pack
issue which tracks the progress of adding pygit2 to our Debian and
Ubuntu repositories.

* Pylint fix
2016-04-25 15:26:09 -06:00
Andrew Hammond
06b7b4fe52 file.retention_schedule state (#32800) 2016-04-25 15:21:13 -06:00
Knut Auvor Grythe
478856815c Support unicode in all GECOS fields on FreeBSD (#32794)
* Support unicode in all GECOS fields on FreeBSD

* Revert erroneous change

* Add unit tests
2016-04-25 15:19:13 -06:00
Alejandro Bednarik
5b59840373 Rsync synchronized updates. (#32739)
Aadded --dry-run option which is also used for test mode
taking adventage of this option in rsync.

Update state documentation to follow Salt standards

Finally synchronized was not working, See #32478. Changes cmd.run to cmd.run_all make this works.
Tests updated
2016-04-25 10:54:33 -06:00
Alejandro Bednarik
af64c95593 Append failed cmd in comments. (#32651)
When onlyif fail, append the message to comment so we know which command
is failing. Only in a list context.

Fixes #32575.
2016-04-22 12:54:58 -06:00
Carlos Perelló Marín
9d028262f4 Server Density agentv2 support (#32772)
* Added support for the agentv2

* Updated os field to match the SD API requirement

* filename is an absolute path on official installations

* Install script URL uses a redirect now, so we should instruct curl to follow them

* Added a missing import

* Updated the settings for the v2 agent

* Fixed pep8 issues

* select v2 agent for the test
2016-04-22 12:50:03 -06:00
rallytime
ce72851861 Merge branch '2014.7' into '2015.5'
Conflicts:
  - salt/netapi/rest_tornado/__init__.py
  - salt/netapi/rest_tornado/saltnado.py
2016-04-22 10:24:06 -06:00
Kai Howelmeyer
20c2cf176b Add max_depth parameter to file.directory, fixes #31989 (#32463) 2016-04-22 10:11:58 -06:00
Seth House
2775edc176 Saltnado /run fix (#32590)
* Revert "Verify auth in saltnado run (#32552)"

This reverts commit b19c5a5ce7.

* Call runner.cmd_async instead to enforce eauth

* Check for both token or user/pass before giving to Salt

* Remove comment as we're now enforcing auth here

* Lint and functionality fix courtesy of Mike P.

* Don't fail the whole request if there's an eauth problem
2016-04-22 10:10:47 -06:00
Dmitry Kuzmenko
1d6d234417 Properly handle minion failback failure. (#32749)
* Properly handle minion failback failure.

Initiate minion restart if all masters down on __master_disconnect like
minion does on the initial master connect on start.

* Fixed unit test
2016-04-22 09:15:55 -06:00
Erik Johnson
67d0c81184 Support remote sources in a source list (#32691)
* Support remote sources in a source list

This commit modifies the source_list check so that remote sources
(http(s), ftp, etc.) are not fetched more than once. To do so, it
adds the use of ``__context__`` in ``cp.cache_file`` and
``file.source_list`` to prevent multiple fetches of a single file in the
same salt run.

* Update tests

Added __context__ to test cases to reflect usage of __context__, and
also added file.source_list to mocked funcs for archive.extracted unit
test.
2016-04-21 08:37:38 -06:00
Eric Radman
84b740e26d Skip utils_test if timelib is not installed (#32699)
date_cast() throws a RuntimeError, not an ImportError
2016-04-20 14:01:21 -06:00
Anthony Shaw
1183106e75 Fix line endings 2016-04-20 01:32:49 +10:00
Anthony Shaw
d2abe56a20 Added some unit tests for GCE and Dimension Data modules 2016-04-19 08:18:25 +10:00
Justin Anderson
f6861768f4 Skipping boto test on OpenSuse (#32624) 2016-04-18 09:57:51 -06:00
Nicole Thomas
9942ea9319 [develop] Merge forward from 2016.3 to develop (#32636)
* Ensure rh_service not used on CloudLinux 7

Add CloudLinux to RHEL-derived distros excluded from rh_service use in osrelease >= 7

* Fix binary search and replace (#32542)

* Don't return None from eval_master (#32555)

Raise an exception instead. Because eval master if returns should return
a tuple.

* redact passwords and hashes from user.present updates

Fixes #32381

* Better log message on minion restart if master couldn't be reached. (#32576)

* Revert PR #32480 and apply #32314 with fixes / documentation (#32558)

* Revert "Fix loop in maint.flo"

This reverts commit 5196cd6a6e5db3c7b1a47b1740881bbd3e87ea3d.

* Revert "Clear VCS fsbackend and git_pillar locks on master start"

This reverts commit 7e3caa9bae1ac4de62db9924374e35a8b826937e.

* Revert "Add functions to remove VCS fsbackend update locks and git_pillar update/checkout locks"

This reverts commit 4c2db32419022501eae2a695ec488693e043d189.

* prevent eternal gitfs lock due to process crash

* Use salt.utils.fopen() instead of open()

* Make pid locking work for more than just gitfs

Also, make logging more descriptive, to aid in troubleshooting.

* Add git_pillar_global_lock config option default value

* Document proper usage of {gitfs,git_pillar}_global_lock

* Fix comments value in salt.states.pkgrepo example (#32604)

'comments' option adds '#' automatically. Example contains `#http://mirror.centos.org/centos/$releasever/os/$basearch/` string which becomes prefixed with '##' in generated file.

* alphabetize directories for dynamic modules (#32599)

Also add engines and proxy minions to the list.

* Expand on the open-source vs open-core FAQ

* Language clarification.

* Fix some mistakes in the salt-ssh thin shell script (#32583)

* [[ is bash, not compatible with /bin/sh

* check if python command exists before calling it

* Deprecate 'user' and 'group' in state cmd (#32613)

* Remove unused 'group' argument

* Fix unit testing of cmd.mod_run_check without group arg

* Deprecate 'user/group' in cmd.run

* Deprecate 'user'/'group' in cmd.script

* Deprecate 'user' in cmd.wait

* Deprecate 'user'/'group' in cmd.wait_script

* Fix mod_run_check without 'group'

* Push deprecation back one release

* Fix mac_service and mac_system modules (#32587)

* Fix mac_service module

* Add integration tests for new functions

* Start will not enable the service beforehand

* Remove unused variables
2016-04-18 08:40:20 -06:00
ksvasan
c90bcfe1db Enable blocking on min_party until minimum set of nodes are available (#32592)
* Enable blocking on min_party until minimum set of nodes are available

* Fix the comment in min_party for salt-pr-lint-n

* Add test cases to the min_party method

* Fix the lint issues causing build failure

* Change the comment for test_min_party

* CR comments for modules/zk_concurrency.py

* Adding more examples for blocking/min_nodes

* Change the comment formatting

* Removing space at end of line

* Comments changes to rebuild
2016-04-15 13:35:29 -06:00
Ronald van Zantvoort
c25dffe7a9 Deprecate 'user' and 'group' in state cmd (#32613)
* Remove unused 'group' argument

* Fix unit testing of cmd.mod_run_check without group arg

* Deprecate 'user/group' in cmd.run

* Deprecate 'user'/'group' in cmd.script

* Deprecate 'user' in cmd.wait

* Deprecate 'user'/'group' in cmd.wait_script

* Fix mod_run_check without 'group'

* Push deprecation back one release
2016-04-15 13:30:56 -06:00
rallytime
efe3ec82da Merge branch '2016.3' into 'develop'
Conflicts:
  - doc/ref/configuration/master.rst
  - salt/modules/glusterfs.py
  - salt/modules/service.py
  - tests/unit/modules/glusterfs_test.py
2016-04-13 16:10:33 -06:00
rallytime
b77993d9a1 Merge branch '2015.8' into '2016.3'
Conflicts:
  - doc/ref/configuration/minion.rst
  - doc/topics/targeting/grains.rst
  - salt/crypt.py
  - salt/scripts.py
  - salt/states/dockerng.py
  - salt/states/pkg.py
2016-04-13 09:42:54 -06:00
Nicole Thomas
1834bdefe3 Merge pull request #32531 from ticosax/support-no-volumes
[dockerng] Fix support of dockerng.volume_present when no volume is on present.
2016-04-13 08:42:12 -06:00
Nicolas Delaby
5d73d54ed2 Enhance dockerng.wait() to control success on exit_code and on already stopped containers (#32475) 2016-04-13 08:16:26 -06:00
Bo Maryniuk
214f01e963 Bugfix: salt-key crashes if tries to generate keys to the directory w/o write access (#32436)
* Raise an exception if keys are tried to be written to the directory that has no write access permissions

* Show an reasonable error message instead of a traceback crash.

* Fix the unit tests
2016-04-13 08:15:37 -06:00
Nicolas Delaby
958b2ec749 Fix support of dockerng.volume_present when no volume is on present.
fixes #32493
2016-04-13 15:47:13 +02:00
Eric Radman
bae492ad8f Fix tests that assert CommandExecutionError (#32485)
Trying to assert that an exception was raised using
helper_open.write.assertRaises() is bogus--there is no such method. Use
standard unittest.assertRaises() instead.
2016-04-12 08:41:25 -06:00
Bo Maryniuk
492ebfc184 Isbm zypper list products sles11 crash (#32505)
* Check for EOL aggregate and fix time_t attribute

* Update SLE11 SP3 data

* Update SLE12 SP1 data

* Adjust test values according to the testing data
2016-04-12 08:14:19 -06:00
Nicole Thomas
216d9fdc9a [develop] Merge forward from 2016.3 to develop (#32494)
* fix sorting by latest version when called with an attribute

* remove reference to master_alive_check

* Fixes saltstack/salt#28262

* Resolve memory leak in authentication

* outputter virt_list does not exist anymore

* Update proxmox documentation

* Fix documentation on boto_asg and boto_elb modules and states

* modules.win_timezone: don't list all zones in debug log

* Correcty index glusterfs bricks

Fixes issue #32311

* Cleaner deprecation process with decorators

* Add deprecation decorator scaffold

* Capture type error and unhandled exceptions while function calls

* Aware of the current and future version of deprecation

* Implement initially is_deprecated decorator

* Add an alias for the capitalization

* Fix capitalization easier way

* Remove an extra line

* Add successor name to the deprecation decorator.

* Granulate logging and error messages.

* Implement function swapper

* Raise later the caught exception

* Clarify exception message

* Save function original name

* Remove an extra line

* Hide an alternative hidden function name in the error message, preserving the error itself

* Rename variable as private

* Add a method to detect if a function is using its previous version

* Message to the log and/or raise an exception accordingly to the status of used function

* Log an error along with the exception

* Add internal method documentation

* Add documentation and usage process for decorator "is_deprecated"

* Add documentation and process usage for the decorator "with_deprecated"

* Hide private method name

* Fix PEP8, re-word the error message

* Deprecate basic uptime function

* Add initial decorator unit test

* Rename old/new functions, mock versions

* Move frequent data to the test setup

* Add logging on EOL exception

* Rename and document high to low version test on is_deprecated

* Implement a test on low to high version of is_deprecated decorator

* Add a correction to the test description

* Remove a dead code

* Implement a test for high to low version on is_deprecated, using with_successor param

* Correct typso adn mistaeks

* Implement high to low version with successor param on is_deprecated

* Setup a virtual name for the module

* Implement test for with_deprecated should raise an exception if same deprecated function not found

* Implement test for with_deprecated an old function is picked up if configured

* Correct test description purpose

* Implement test with_deprecated when no deprecation is requested

* Add logging test to the configured deprecation request

* Add logging testing when deprecated version wasn't requested

* Implement test EOL for with_deprecated decorator

* Correct test explanation

* Rename the test

* Implement with_deprecated no EOL, deprecated other function name

* Implement with_deprecated, deprecated other function name, EOL reached

* Add test description for the with_deprecated + with_name + EOL

* Fix confusing test names

* Add logging test to the is_deprecated decorator when function as not found.

* Add more test point to each test, remove empty lines

* Bugfix: at certain conditions a wrong alias name is reported to the log

* Fix a typo in a comment

* Add test for the logging

* Disable a pylint: None will _never_ be raised

* Fix test for the deprecated "status.uptime" version

* Bugfix: Do not yank raised exceptions

* Remove unnecessary decorator

* Add test for the new uptime

* Add test for the new uptime fails when /proc/uptime does not exists

* Rename old test case

* Skip test for the UTC time, unless freeze time is used.

* Fix pylint

* Fix documentation

* Bugfix: proxy-pass the docstring of the decorated function

* Lint fix

* Fixes saltstack/salt#28262 for 2015.5 branch

* Update master config docs

* Improve git_pillar documentation/logging

* Add note about different behavior of top file in git_pillar

* Make log entry for a missing pillar SLS file more accurate for git_pillar

* FreeBSD supports packages in format java/openjdk7 so the prior commit broke that functionality. Check freebsd/pkg#1409 for more info.

* FreeBSD supports packages in format java/openjdk7 so the prior commit broke that functionality. Check freebsd/pkg#1409 for more info.

* Update glusterfs_test to be inline with #32312

* Fix salt-cloud paralell provisioning

Closes #31632

* Ignore Raspbian in service.py __virtual__ (#32421)

* Ignore Raspbian in service.py __virtual__

This prevents more than one execution module from trying to load as the
service virtual module.

Refs: #32413

* pack __salt__ before loading provider overrides

We can (and should) pack here since we're just packing a reference to the
object. __salt__ needs to be available when we're loading our provider
overrides

* Fix broken __salt__ dict in provider override

Using ret.items() here sets ``__salt__`` to its items (tuple containing
function name and reference), breaking usage of ``__salt__`` inside
overridden functions.

* Merge #32293 with test fixes (#32418)

* Fix issue #11497

* Remove check for working directory presence in tests

* Fix Domainname introspection

Default value needs to be extracted from the container itself,
because dockerd set Domainname value when network_mode=host.

* Add pgjsonb_queue to queue doc index

* Pylint fixes

* Pass parser options into batch mode

Resolves #31738

* Changed the target file in file.symlink test (#32443)

* Argument name in docs should match actual arg name (#32445)

Fixes #31851

* tests.integration: bypass MacOS TMPDIR, gettempdir (#32447)

Updates 0edd532, 8f558a5.

When logging in as root over `ssh root@host`, `$TMPDIR` and
`tempfile.gettempdir()` are both set to a variation of:
```
/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/
```
When logging in as root over `sudo -i`, `$TMPDIR` is unset and
`tempfile.gettempdir()` is set to `/tmp`.

My guess is that the second case is an unintended or uncorrected omision
by Apple as they have introduced the longer, randomized temp path in a
recent version of MacOS.

* Issue #28706: Fix state user.present behavior. (#32448)

- As mentionned in issue #28706, state user.present no longer remove
      user from groups if the keyword 'groups' with empty value '[]' is not
      explicitly set, salt will assume current groups are still wanted.

* tests.integration: fix 4230c8a

* Move the tables of virtual modules to individual documentation pages

* Add new doc pages to toctree

* Add external ref to windows package manager docs

* Improve docstrings

* Add documentation on virtual module provider overrides to the module docs

* Clarify the scope of the provider param in states.

* Add link to provider override docs to all package providers

* Add link to provider override docs to all service providers

* Add link to provider override docs to all user providers

* dd link to provider override docs to all shadow providers

* Add link to provider override docs to all group providers

* Backport 31164 and 31364 (#32474)

* Don't send REQ while another one is waiting for response.

The message has to be removed from the queue the only *after* it's
already processed to don't confuse send() functionality that expects
empty queue means: there's no active sendings.

* Fixed zeromq ReqMessageClient destroy

* Add link to provider override docs to opkg.py

This is a companion to https://github.com/saltstack/salt/pull/32458, but
this module was not added until the 2016.3 branch, so the documentation
is being updated there for this module.

* Add documentation for some master/minion configs (#32454)

Refs #32400

Adds docs for:

- cli_summary
- event_return_queue
- event_return_whitelist
- event_return_blacklist
- file_recv_max_size
- fileserver_followsymlinks
- fileserver_ignoresymlinks
- fileserver_limit_traversal

* Automatically detect correct MySQL password column for 5.7 and fix setting passwords (#32440)

* Automatically detect MySQL password column

* Fix changing password in MySQL 5.7

* Fix lint test

* Fix unit tests (?)

They will still fail if "authentication_string" is legitimately the right column name, but I don't know what to do about that.

* Additional unit test fix

* Only unsub if we have a jid

Closes #32479
2016-04-11 17:07:15 -06:00
rallytime
4f03f2311f Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/cli/salt.py
  - salt/modules/win_pkg.py
  - salt/transport/tcp.py
2016-04-11 14:33:21 -06:00
Neil Williamson
4372dc3816 Automatically detect correct MySQL password column for 5.7 and fix setting passwords (#32440)
* Automatically detect MySQL password column

* Fix changing password in MySQL 5.7

* Fix lint test

* Fix unit tests (?)

They will still fail if "authentication_string" is legitimately the right column name, but I don't know what to do about that.

* Additional unit test fix
2016-04-11 11:07:44 -06:00
Justin Anderson
116c91e293 Changed the target file in file.symlink test (#32443) 2016-04-08 16:00:15 -06:00
Nicole Thomas
49af98b7a7 Merge pull request #32431 from rallytime/merge-develop
[develop] Merge forward from 2016.3 to develop
2016-04-08 11:17:28 -06:00
rallytime
d942c38cb1 Removed useless slack_notify unit tests 2016-04-08 11:13:14 -06:00
Nicole Thomas
8d44aa3f08 Merge pull request #32429 from rallytime/merge-2016.3
[2016.3] Merge forward from 2015.8 to 2016.3
2016-04-08 10:56:12 -06:00
Eric Radman
2d9f8ab27e Skip PAM test on OpenBSD (#32439)
Will always fail since OpenBSD does not have have PAM
2016-04-08 10:19:41 -06:00
Nicole Thomas
6a88b5ef29 Merge pull request #32422 from eradman/env_test
Do not assume temporary files have the user's gid
2016-04-08 10:16:50 -06:00
rallytime
7f8eb751a0 Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/cli/daemons.py
  - salt/modules/win_servermanager.py
  - tests/unit/modules/win_servermanager_test.py
2016-04-08 10:09:03 -06:00
Eric Radman
504cc02741 Do not assume temporary files have the user's gid
On BSD-like systems (including MacOS) files created in /tmp (or any dir
with mod 1777) do not have the user's group. Therefore the st_gid for
files created in /tmp will usually be wheel. Easiest thing to do is to
skip this test.
2016-04-07 22:32:33 -04:00
rallytime
59b804d230 Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/modules/pkgng.py
  - salt/modules/status.py
  - salt/states/boto_asg.py
  - salt/states/boto_elb.py
2016-04-07 16:28:59 -06:00
Justin Anderson
ec284fdff4 Fix issue that #32420 exposed in timezone_test 2016-04-07 16:19:27 -06:00
rallytime
9531ea6ef5 Merge branch '2015.5' into '2015.8'
Conflicts:
  - doc/topics/highavailability/index.rst
  - salt/loader.py
  - salt/modules/service.py
  - salt/states/cmd.py
  - tests/unit/states/cmd_test.py
2016-04-07 16:10:32 -06:00
Eric Radman
b220b4dd98 Unbreak timezone test for Gentoo (#32420)
Gentoo and Debian both use use /etc/timezone

See https://wiki.gentoo.org/wiki/System_time
2016-04-07 14:55:51 -06:00
Nicole Thomas
0809126d8e Merge #32293 with test fixes (#32418)
* Fix issue #11497

* Remove check for working directory presence in tests
2016-04-07 14:55:25 -06:00
Justin Anderson
6f98bd50eb Update glusterfs_test to be inline with #32312 2016-04-07 14:38:21 -06:00
Justin Anderson
28ea60f28e Fixes test failure where Fedora 23 has /etc/grub.conf by default 2016-04-07 11:40:12 -06:00
James O'Neill
c2442ad46f Discard duplicate YAML nodes when merging anchors to avoid duplicate … (#32042)
* Discard duplicate YAML nodes when merging anchors to avoid duplicate node errors. Add yamlloader unit tests.

Fixed #14550 Using YAML anchors/references in Pillars causes conflicting IDs

* Fix lint errors. Make external function a static method.

* Fix remaining lint errors in unit test file.
2016-04-07 10:27:20 -06:00
Bo Maryniuk
0d9a06b8c6 Cleaner deprecation process with decorators
* Add deprecation decorator scaffold

* Capture type error and unhandled exceptions while function calls

* Aware of the current and future version of deprecation

* Implement initially is_deprecated decorator

* Add an alias for the capitalization

* Fix capitalization easier way

* Remove an extra line

* Add successor name to the deprecation decorator.

* Granulate logging and error messages.

* Implement function swapper

* Raise later the caught exception

* Clarify exception message

* Save function original name

* Remove an extra line

* Hide an alternative hidden function name in the error message, preserving the error itself

* Rename variable as private

* Add a method to detect if a function is using its previous version

* Message to the log and/or raise an exception accordingly to the status of used function

* Log an error along with the exception

* Add internal method documentation

* Add documentation and usage process for decorator "is_deprecated"

* Add documentation and process usage for the decorator "with_deprecated"

* Hide private method name

* Fix PEP8, re-word the error message

* Deprecate basic uptime function

* Add initial decorator unit test

* Rename old/new functions, mock versions

* Move frequent data to the test setup

* Add logging on EOL exception

* Rename and document high to low version test on is_deprecated

* Implement a test on low to high version of is_deprecated decorator

* Add a correction to the test description

* Remove a dead code

* Implement a test for high to low version on is_deprecated, using with_successor param

* Correct typso adn mistaeks

* Implement high to low version with successor param on is_deprecated

* Setup a virtual name for the module

* Implement test for with_deprecated should raise an exception if same deprecated function not found

* Implement test for with_deprecated an old function is picked up if configured

* Correct test description purpose

* Implement test with_deprecated when no deprecation is requested

* Add logging test to the configured deprecation request

* Add logging testing when deprecated version wasn't requested

* Implement test EOL for with_deprecated decorator

* Correct test explanation

* Rename the test

* Implement with_deprecated no EOL, deprecated other function name

* Implement with_deprecated, deprecated other function name, EOL reached

* Add test description for the with_deprecated + with_name + EOL

* Fix confusing test names

* Add logging test to the is_deprecated decorator when function as not found.

* Add more test point to each test, remove empty lines

* Bugfix: at certain conditions a wrong alias name is reported to the log

* Fix a typo in a comment

* Add test for the logging

* Disable a pylint: None will _never_ be raised

* Fix test for the deprecated "status.uptime" version

* Bugfix: Do not yank raised exceptions

* Remove unnecessary decorator

* Add test for the new uptime

* Add test for the new uptime fails when /proc/uptime does not exists

* Rename old test case

* Skip test for the UTC time, unless freeze time is used.

* Fix pylint

* Fix documentation

* Bugfix: proxy-pass the docstring of the decorated function

* Lint fix
2016-04-06 12:55:45 -06:00
rallytime
093d833ff1 Merge branch '2016.3' into 'develop'
Conflicts:
  - pkg/osx/build.sh
2016-04-05 15:38:58 -06:00
rallytime
760f479424 Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/cli/daemons.py
  - salt/config/__init__.py
  - salt/scripts.py
  - salt/state.py
  - tests/unit/config/config_test.py
2016-04-05 15:09:27 -06:00
Justin Anderson
73118d0149 Deleted win_servermanger_test.py 2016-04-04 12:48:05 -06:00
Mike Place
95bcdaa4bb Merge pull request #32287 from rallytime/reimplement-31172
Reimplement #31172, which got removed in a merge-forward.
2016-04-04 11:53:11 -06:00
Mike Place
edbab99164 Merge pull request #32295 from rallytime/test-cloud-deploy-dir
Test the contents of 'deploy_scripts_search_path' in salt.config.cloud_config
2016-04-04 11:38:47 -06:00
Benjamin Drung
8cada9573f Fix typos of retrieve 2016-04-04 14:27:41 +02:00
Justin Findlay
e7ee59fb6c modules.parallels: add unit tests 2016-04-02 16:42:00 -06:00
rallytime
4037476f40 Patch call to os.path.isdir so we know both search paths are in tuple 2016-04-01 15:13:57 -06:00
rallytime
e195376f61 Patch isdir call and test seach path tuple positions as well 2016-04-01 15:09:57 -06:00
rallytime
b86f6922c4 Print search_paths return for debugging 2016-04-01 13:52:43 -06:00
rallytime
eb6773823b Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/modules/rh_service.py
2016-04-01 10:33:44 -06:00
rallytime
bf48922e7d Add test for 'deploy_scripts_search_path' contents in salt.config.cloud_config 2016-04-01 09:43:30 -06:00
rallytime
49a4eec051 Test the contents of 'deploy_scripts_search_path' in salt.config.cloud_config
Refs #32183
2016-04-01 09:40:58 -06:00
Mike Place
4ce67e6f2c Merge pull request #32120 from cmercier/firewalld
firewalld state/module : add runtime and persist + add rich_rules + merge bind and present
2016-03-31 10:20:19 -06:00
Erik Johnson
3e374e7ec6 Merge pull request #32243 from isbm/isbm-zypper-list-installed-ensure-latest
Ensure latest pkg.info_installed ensure latest
2016-03-31 11:09:59 -05:00
Mike Place
5ad98159af Fix unit test for mysql
Refs #32266
2016-03-31 08:45:17 -06:00
Clément Mercier
1c05ed120d firewalld state/module : add runtime and persist + add rich_rules + merge bind and present 2016-03-31 16:17:52 +02:00
Bo Maryniuk
73ad8a2bfc Fix lint 2016-03-31 01:55:38 +02:00
twangboy
5ca4ad6675 Fix unit tests for state 2016-03-30 17:12:12 -06:00
rallytime
ea3d21d126 Fix failing test 2016-03-30 16:53:42 -06:00
twangboy
b26cb76abb Fix unit tests 2016-03-30 16:51:58 -06:00
rallytime
fa5e17b342 Merge branch '2015.8' into '2016.3'
Conflicts:
  - salt/modules/win_service.py
  - salt/modules/zypper.py
  - salt/states/pkgrepo.py
2016-03-30 15:33:13 -06:00
Mike Place
4a5d1b1dd3 Merge pull request #31768 from twangboy/mac_xattr_int
Integration Tests for mac_xattr.py
2016-03-30 13:03:25 -06:00
Bo Maryniuk
f07c7ea792 Add lowpkg tests for version comparison 2016-03-30 17:33:24 +02:00
Bo Maryniuk
afdf451d87 Remove tests from the zypper_test that belongs to rpm_test 2016-03-30 17:33:03 +02:00
twangboy
66afd4855c Fix unit tests 2016-03-30 08:56:49 -06:00
twangboy
93f252d868 Fix some pylint errors 2016-03-30 08:56:49 -06:00
twangboy
f5f7249c37 Fix unit tests 2016-03-30 08:56:49 -06:00
twangboy
3c1c076d78 Fix unit tests 2016-03-30 08:46:02 -06:00
Justin Anderson
22ef15e9b7 Fixed boto_lambda_test
VpcConfig was not added to function_ret, which was causing
test_that_when_describing_function_it_returns_the_dict_of_properties_returns_true
to fail.
2016-03-29 16:32:57 -06:00
Mike Place
4ad92da5c4 Merge pull request #32214 from jtand/fix_test_kill
Undo previous fix for a more correct fix for process_test.test_kill
2016-03-29 13:15:20 -06:00
Justin Anderson
b25e995efd Lint fix 2016-03-29 10:57:46 -06:00
Justin Anderson
5a57f2e1c6 Undo previous fix for a more correct fix for process_test.test_kill 2016-03-29 09:58:28 -06:00
Nicolas Delaby
c989ae5a7e Merge user defined labels with one carried by the image 2016-03-29 11:50:08 +02:00
Nicole Thomas
f513e401d8 Merge pull request #32188 from jtand/fix_test_kill
Fix test kill
2016-03-28 16:38:48 -06:00
Mike Place
921cfe1fe4 Merge pull request #32181 from jtand/fix_test_kill
Fix test kill
2016-03-28 13:46:13 -06:00
Justin Anderson
0f4f303380 Lint fix 2016-03-28 12:37:52 -06:00
rallytime
fd0dd36b12 Lint develop branch 2016-03-28 11:47:41 -06:00
Justin Anderson
a74bb9b67f Fix the process_test.test_kill failure in 2016.3 2016-03-28 11:33:55 -06:00
rallytime
d684d49490 Merge branch '2016.3' into 'develop'
Conflicts:
  - doc/topics/releases/2015.5.10.rst
  - doc/topics/releases/2015.8.8.rst
2016-03-28 11:16:22 -06:00
Mike Place
6ac3f4d0b4 Merge pull request #32138 from tegbert/fix-nova-driver-bug-parsing-ip-address
Fix nova driver bug parsing ip address
2016-03-28 10:08:32 -06:00
Mike Place
0bde9f0aef Merge pull request #32155 from cachedout/lint_32008
Lint 32008
2016-03-25 12:40:21 -06:00
rallytime
f6d9cdc633 Merge branch '2015.8' into '2016.3'
Conflicts:
  - doc/ref/states/compiler_ordering.rst
  - doc/topics/installation/suse.rst
  - doc/topics/jobs/schedule.rst
  - doc/topics/targeting/grains.rst
  - doc/topics/tutorials/preseed_key.rst
  - doc/topics/tutorials/states_pt5.rst
  - pkg/suse/use-forking-daemon.patch
  - salt/minion.py
  - salt/modules/pacman.py
  - salt/modules/state.py
  - salt/modules/yumpkg.py
2016-03-25 11:47:16 -06:00
rallytime
58c844a7d7 Add mac_desktop integration tests
- Updates mac_desktop module to use cmd.run_all
- Updates current mac_desktop_test unit tests with cmd.run_all change
- Adds integration tests for mac_desktop execution module
2016-03-24 17:02:53 -06:00
Mike Place
3b2c1ccf36 Merge pull request #32110 from rallytime/mac-desktop-tests
Add mac_desktop integration tests
2016-03-24 16:58:26 -06:00
rallytime
6886681410 Fix test failures 2016-03-24 16:45:03 -06:00
Mike Place
1545b80017 Merge pull request #32034 from twangboy/mac_pkgutil_int
Integration tests for mac_pkgutil
2016-03-24 15:44:51 -06:00
Justin Anderson
d172b1d270 Fix the process_test.test_kill failure in 2016.3 2016-03-24 14:31:43 -06:00
Justin Anderson
f8080b8e59 Re-enable some skipped Boto tests 2016-03-24 10:30:48 -06:00
rallytime
34300847ec Fix test failures 2016-03-24 09:48:54 -06:00
rallytime
6b92ef1924 Add mac_desktop integration tests
- Updates mac_desktop module to use cmd.run_all
- Updates current mac_desktop_test unit tests with cmd.run_all change
- Adds integration tests for mac_desktop execution module
2016-03-23 17:31:41 -06:00
rallytime
a333210a08 Merge branch '2016.3' into 'develop'
Conflicts:
  - doc/conf.py
  - salt/modules/rabbitmq.py
  - salt/states/rabbitmq_user.py
  - tests/unit/states/rabbitmq_user_test.py
2016-03-23 16:10:31 -06:00
Brian Stevenson
1500aae027 set deleted value to list 2016-03-23 13:47:12 -07:00
Brian Stevenson
1dc8f5f289 unit test update
grain value looks for list in assertion
2016-03-23 10:50:32 -07:00
rallytime
55544a84a1 Merge branch '2016.3' into 'develop'
Conflicts:
  - salt/minion.py
2016-03-23 11:04:42 -06:00
rallytime
fa09de7a58 Merge branch '2015.8' into '2016.3'
Conflicts:
  - tests/unit/states/rabbitmq_user_test.py
2016-03-23 10:56:25 -06:00
Mike Place
e19fe847bd Merge pull request #32062 from rallytime/mac-assistive-tests
Mac assistive tests
2016-03-23 09:51:36 -06:00
Nicole Thomas
57cf405fd6 Merge pull request #31552 from alprs/fix-localectl
Bring back localectl parsing in locale module for when dbus module is unavailable
2016-03-23 09:47:27 -06:00
Nicole Thomas
37c410fee4 Merge pull request #32079 from rallytime/merge-32041
Merge #32041 with test removal
2016-03-23 09:42:35 -06:00
rallytime
b13fdc1831 Remove useless tests 2016-03-23 08:49:52 -06:00
Stefan Schweer
1ee6e7b04f replaced ',' for whitespace as split seperator for rabbitmq tags
- fixed unit tests
   * fixed test for states.rabbitmq_user.present
2016-03-23 11:55:27 +01:00
Justin Anderson
df9abd5021 Skipped test if zeromq is not transport 2016-03-22 16:01:18 -06:00
Kris Raney
3c6d0e8fc1 Make sure there are no connection object cache hits on boto_* unit tests. 2016-03-22 14:49:18 -06:00
Nicole Thomas
9216e303e1 Merge pull request #31961 from kraney/kraney_bugfix
Make sure there are no connection object cache hits on boto_* unit te…
2016-03-22 14:38:46 -06:00
rallytime
b1bdb688ae Add unit tests for new remove function, too. 2016-03-22 14:25:49 -06:00
rallytime
88ba210f86 Add mac_assistive integration tests
- Updates mac_assistive module to use cmd.run_all
- Updates current mac_assistive_test unit tests with cmd.run_all change
- Adds module integration tests for mac_assistive execution module
2016-03-22 14:11:40 -06:00
twangboy
158ebc76b8 Fix unit tests for mac_utils 2016-03-22 13:46:19 -06:00
Colton Myers
95c08f55e9 Tear out useless unit test 2016-03-22 13:46:06 -06:00
Stefan Schweer
d317f7134f replaced ',' for whitespace as split seperator for rabbitmq tags
- fixed unit tests
   * fixed test for states.rabbitmq_user.present
2016-03-22 18:01:57 +01:00