Commit graph

107928 commits

Author SHA1 Message Date
Christian McHugh
c58707e0de fix lint comparison 2020-05-07 13:58:34 -07:00
Christian McHugh
d6aa368b0d Update baredoc to dump docstrings like sys.doc 2020-05-07 13:58:34 -07:00
twangboy
9ccb7edbc9 Add ability to add hwaddr and macaddr
Adds the ability to add `hwaddr` and `macaddr` to the network config for
Redhat based systems. Adds tests.
2020-05-07 13:57:33 -07:00
twangboy
16457386a6 Fix issue when pillars are integers
Fixes an issue where some pillar data may have integer keys. This was
causing the sorted function to fail. See issue #56909
2020-05-07 13:57:07 -07:00
twangboy
4684c9dca1 Add some tests 2020-05-07 13:54:45 -07:00
twangboy
dc37eaea01 Return a more meaningful error on unmapped accounts
Fixes an issue in win_groupadd where an unmapped account would throw a
double stacktrace. One for the error and another when it tried to look
up the error code to get the message. Since pywintypes.com_error returns
a good text string, we'll just use that instead of trying to look it up
again.

This code is being covered by an existing test.
2020-05-07 13:54:45 -07:00
Ch3LL
1ba615f306 Port #51754 to master 2020-05-07 13:54:01 -07:00
David Murphy
66bbcad197 Added syndic to log rotation 2020-05-07 13:52:05 -07:00
twangboy
bb415d9099 Fix typo 2020-05-07 13:50:17 -07:00
twangboy
c6caee2b60 Fix some lint 2020-05-07 13:50:17 -07:00
twangboy
dfdcf95d93 Fix stacktrace in return from win_pkg
Returns a meaningful message without the stacktrace
Adds some tests
2020-05-07 13:50:17 -07:00
Pedro Algarvio
5852d60dbf No global variables, fix tests. 2020-05-07 13:49:10 -07:00
Alexander Werner
3ddd6539c7 saltclass: Reference classes with globs
Allow the list of classes in saltclass external pillar/master_tops
to include shell-style globs.
2020-05-07 13:49:10 -07:00
Joe Eacott
5b708dba40 Forgot to add variable for when import is successful 2020-05-07 13:36:34 -07:00
Joe Eacott
1d08b27817 Add non-windows modules into try except as to not fail 2020-05-07 13:36:34 -07:00
xetix
09c5d8b6c1 Port #53681 to master 2020-05-07 13:36:34 -07:00
Daniel Wozniak
42dccb8eed
Merge pull request #56372 from jdsieci/master-x509_fixes
Fix for #41858
2020-05-07 13:28:56 -07:00
MKelley80
a6b63cb81d Port #49617 to master 2020-05-07 13:27:31 -07:00
twangboy
86e061f91e Add tests 2020-05-07 13:26:41 -07:00
Alan Cugler
b243673de7 replaced the target=None in three of the git functions to just target
since they require a target to function.
2020-05-07 13:26:41 -07:00
Erik Johnson
eaa96bb59d aptpkg: Fix installing 32-bit packages on 64-bit OS
This was broken because a normalize_name function was added to aptpkg,
which was incorrectly written. The pkg states use this function, if
present, to figure out whether or not the package architecture needs to
be stripped from the package name. However, this recently-added function
was *always* stripping the architecture, causing 32-bit suffixes to be
stripped.

This commit fixes the incorrect implementation of normalize_name and
adds a unit test.
2020-05-07 13:25:34 -07:00
Erik Johnson
1bee7c8a3a Confirm that the correct number of procs is returned 2020-05-07 13:24:33 -07:00
Erik Johnson
05e4822199 Check for num_processes based on length of return list 2020-05-07 13:24:33 -07:00
Erik Johnson
c208101d66 Don't needlessly call _get_proc_cmdline an extra time 2020-05-07 13:24:33 -07:00
Erik Johnson
a6f6b66016 Sort on diff, not pid 2020-05-07 13:24:33 -07:00
Erik Johnson
7b48ac007d Catch NoSuchProcess 2020-05-07 13:24:33 -07:00
Erik Johnson
0db615b40b Fix race condition in ps.top
When a process ends between the start of the function and the end, a
psutil.NoSuchProcess exception will be raised if you try to invoke
member functions of a psutil.Process object for that PID.
2020-05-07 13:24:33 -07:00
Erik Johnson
92fc17115b Fix broken ps.top
This fixes two problems:

1. Poorly-designed handling of unpacking selective items from a
   `psutil.Process` instance, leading to ValueError. This is fixed by
   slicing.

2. `psutil.Process` objects are not sortable on Python 3. Fixed by using
   a key lambda to sort on the `pid` attribute.
2020-05-07 13:24:33 -07:00
Amit Chotaliya
90dd22c3b3 Feature to enable/disable termination protection for ec2 instancesi
Fixes: #45496
2020-05-07 13:23:13 -07:00
Erik Johnson
b49f1374f3 apparently fixing black's pylint breakage... breaks black. cool. 2020-05-07 13:22:01 -07:00
Erik Johnson
78609a236d fix lint error caused by black 2020-05-07 13:22:01 -07:00
Erik Johnson
ce76f4a449 Add test case 2020-05-07 13:22:01 -07:00
Erik Johnson
af884cef10 Remove weird PY3 restriction
The issue with different behavior between Python 2 and 3 was fixed in
ffdae27877 around the same time the
original PR was opened. There is no need to restrict this code
exclusively to Python 3.
2020-05-07 13:22:01 -07:00
jp-harvey
15a0b35f8e Add support for gce accelerators 2020-05-07 13:22:01 -07:00
Erik Johnson
42ea39aadc Add test cases for scaleway query 2020-05-07 13:21:22 -07:00
Erik Johnson
dc6d60fabd Only make one call to get cloud profile 2020-05-07 13:21:22 -07:00
Robert Schmidt
dcf01e45bd updating per @gtmanfred review 2020-05-07 13:21:22 -07:00
Robert Schmidt
c48598bbe2 http_method update with capitalization (seems to be needed for http.query) 2020-05-07 13:21:22 -07:00
Robert Schmidt
ae129a50fe Update to use marketplace url by default 2020-05-07 13:21:22 -07:00
Robert Schmidt
1e31d7cd48 update for problems with scaleway api 2020-05-07 13:21:22 -07:00
Pedro Algarvio
83e0c6e929 Speed up our skip helpers 2020-05-07 13:09:02 -07:00
Pedro Algarvio
b7f99d180f Inspect test classes to avoid running setUpClass and tearDownClass
If a test class has all it's tests marked to be skipped, we mark the
class to be skipped so that `setUpClass` and `tearDownClass` doesn't
even run.
2020-05-07 13:09:02 -07:00
Wayne Werner
1e16375702 Inline our code with what unittest.case.skip does 2020-05-07 13:09:02 -07:00
Wayne Werner
ca4e3c5e93 Add missing windows skip 2020-05-07 13:09:02 -07:00
Daniel A. Wozniak
1036056b0c Fix runner tests on windows 2020-05-07 13:09:02 -07:00
Daniel A. Wozniak
8f6ac02c32 Fix wart in docker tests with slowTest decorator 2020-05-07 13:09:02 -07:00
Daniel A. Wozniak
675cd8db04 Handle un-ordered test decorators 2020-05-07 13:09:02 -07:00
Pedro Algarvio
2209c25bf9 Add --run-slow flag to runtests.py 2020-05-07 13:09:02 -07:00
rsmekala
d0150f4f4f
Bug fixes in Junos-related components (#55824)
* Merged junos-specific changes on 2019.2

* Merged junos-specific changes on 2019.2

* Fixes FileNotFound exception with invalid dest option in junos.cli

* Fixed documentation for junos.diff

* Fixed improper handling of dest and format options in rpc modules

* Implement exception handling around XML filter parsing

* Porting fix from develop to 2019.2

* Fixed documentation

* Fixed documentation

* Fixed rollback docstring: CLI example

* Implemented exception handling around template rendering in junos.load

* Implemented exception handling around template rendering in junos.install_config

* Fixes broken state module junos.diff

* Fixes broken state module junos.rollback

* Fixes broken state module junos.rpc

* Adds documentation about zeroize functionality for non-root user

* Adds error message for install_config in case invalid mode provided

* Handle LockError case in install_config gracefully

* Replace string concatenation with format

* Revert replacing cli command with rpc: junos.zeroize

* Support dynamic config mode

* Changed CLI example to conform with new rpc module definition

* Added exception handling for invalid image path for install_os module

* Extended load() support to config_action:merge, to match PyEZ capabilities

* Added check to allow only 1 config_action in load()

* Fixed reboot=True scenario for install_os

* Added comments to explain the behaviour in reboot scenario

* Added new option all_re. Updated documentation

* Fixed #117

* Temporary fix for #117

* Modified as per review comments

* Fixes junos.load template case

* Fixed test cases in 2019.2 branch

* Update junos_syslog.py

* Use cache_file instead of get_file

* Revert "Use cache_file instead of get_file"

This reverts commit b679c068de.

* Revert "Use cache_file instead of get_file"

This reverts commit b679c068de.

* added new testcases

* code changes as per review comment by @twangboy

* code changes as per review comment by @twangboy

* fix lint warnings as per saltpylint

* fix pylint, pydoc, and test failures due to junos-eznc version

* Revert "fix pylint, pydoc, and test failures due to junos-eznc version"

This reverts commit 430d5bdb9b.

* Revert "Revert "fix pylint, pydoc, and test failures due to junos-eznc version""

This reverts commit 4e69ce76e3.

* Revert "fix pylint, pydoc, and test failures due to junos-eznc version"

This reverts commit 430d5bdb9b.

* working on fixing comments from saltstack unit runs

* fix: salt.states.junos.rst:20:Pygments lexer name 'set' is not known

* fix as per comment from @dmurphy18 and pre-commit changes

* import line changes as per pre-commit

* changes as per comment from salt team regarding interface syntax

* changes as per comment from salt team regarding interface syntax

* when called from junos.rpc from test, dest is intacct

* pre-commit checks for darwin

* pre-commit check for linux onf py 3.8 and 3.9

Co-authored-by: rsmekala <rsmekala@juniper.net>
Co-authored-by: Nitin Kr <nitinkr@juniper.net>
Co-authored-by: Nitin Kr <nitin.nitp@gmail.com>
Co-authored-by: Shane Lee <slee@saltstack.com>
Co-authored-by: Sage the Rage <36676171+sagetherage@users.noreply.github.com>
Co-authored-by: David Murphy <dmurphy@saltstack.com>
2020-05-07 11:03:25 -07:00
Christian McHugh
2520ae8675
Consolidate some state requisites (#55974)
* add cmd state features to state.py
also dry git state

* dry docker_container

* update docker test

* correct integration test

* clarity improvement

* lint and test fixes

* correct test

* global req updates

* doc update

* doc updates

* remove unused mac requisite implementation

* other macpackage cleanup

* handle missing user in runas

* add test cases unless/onlyif exception handling

* fix macpackage tests

* fix typo
2020-05-06 17:06:03 -07:00