Commit graph

108925 commits

Author SHA1 Message Date
piterpunk
301d98988f Dropped Py2 support from test_lvm.py 2020-08-24 15:08:11 -07:00
piterpunk
ad1b7d0585 Remove Py2 support from grains/lvm.py 2020-08-24 15:08:11 -07:00
piterpunk
18a1c5238d Added unit tests for lvm grains
- Added tests/unit/grains/test_lvm.py file
- Tests covers _linux_lvm and _aix_lvm
2020-08-24 15:08:11 -07:00
piterpunk
c521f72d49 Added salt.grains.lvm to index.rst 2020-08-24 15:08:11 -07:00
piterpunk
deb2a310b0 Added "lvm" grain to list the LVM volumes
- LVM is an important information about a Linux machine.
  Usually Linux servers have most or all their disk
  filesystems using a logical volume as mountpoint.
- This initial support implements a grain called "lvm"
  which returns a dictionary with the volume groups, each
  one with a list of their logical volumes inside:

      VolumeGroup00:
          - LogicalVolume00
          - LogicalVolume01
          - ...
          - LogicalVolumeNN
      VolumeGroup01:
      ...
      VolumeGroupNN:
          - LogicalVolume00
          - LogicalVolume01
          - ...
          - LogicalVolumeNN
2020-08-24 15:08:11 -07:00
Pablo Suárez Hernández
e0886edcfe Add changes suggested by pre-commit 2020-08-24 15:05:36 -07:00
Pablo Suárez Hernández
510953dc40 Pass module name to hasattr function 2020-08-24 15:05:36 -07:00
Pablo Suárez Hernández
3f9dc9dd9e Update salt/modules/swarm.py
Co-authored-by: Wayne Werner <waynejwerner@gmail.com>
2020-08-24 15:05:36 -07:00
Pablo Suárez Hernández
61e0c6e325 Add initial unit tests for swarm module 2020-08-24 15:05:36 -07:00
Pablo Suárez Hernández
7e34ce7e68 Move checks into _is_docker_module function 2020-08-24 15:05:36 -07:00
Pablo Suárez Hernández
2ec77bbef3 Avoid HAS_DOCKER true if import messes with salt.utils.docker 2020-08-24 15:05:36 -07:00
Cédric Bosdonnat
f0b953b2fa Remove buggy start parameter from virt.pool_running docstring
As mentioned by issue #57275, the start parameter in virt.pool_running
documentation is not implemented at all. Remove it from the doc.
2020-08-24 15:03:52 -07:00
Bruno Costa
95cd625473 Installed new pre-commit. errors excluded. 2020-08-24 15:02:49 -07:00
Bruno Costa
5a98ff6d7a fixing bad pre-commit 2020-08-24 15:02:49 -07:00
Bruno Figueiredo da Costa
4fc878c5d7 Added unittest: test_get_mediatype 2020-08-24 15:02:49 -07:00
Bruno Figueiredo da Costa
204611fbef Fix the use of " ", in params, with filter. (second fix) 2020-08-24 15:02:49 -07:00
Bruno Figueiredo da Costa
cb5dd9a0d7 Fix the use of " " on params["filter"]. 2020-08-24 15:02:49 -07:00
Bruno Costa
642fec0364 Fix bad whitespace 2020-08-24 15:02:49 -07:00
Bruno Figueiredo da Costa
583bbe4cdb Changes for BUG opened: 56995
Fix mediatype_create and mediatype_get usage since new API 4.4.

- Added a apiinfo_version call to check the API version when
  dealing with mediatype_create and get.
- Changed the attribute called from "description" to "name",
  when API version is greater or equal to 4.4. changed both
  mediatype_create and mediatype_get.
2020-08-24 15:02:49 -07:00
Pablo Suárez Hernández
2fe82864e0 Add unit test for checking missing fun in SSH events 2020-08-24 15:01:55 -07:00
Daniel A. Wozniak
2facb29019 Blacken changed files 2020-08-24 15:01:55 -07:00
Daniel A. Wozniak
8bd9e42f65 Blacken changed files 2020-08-24 15:01:55 -07:00
Pablo Suárez Hernández
5ede75d432 Add missing 'fun' for returns from wfunc executions 2020-08-24 15:01:55 -07:00
piterpunk
af9b0a6580 Added changelog entries 2020-08-24 14:48:13 -07:00
piterpunk
ed58824239 Many changes in LVM state and module
- Added tests for pvresize and lvextend
- Added support to shrink a LVM logical volume in state lvm.lv_present
- Added support to resize filesystem in state lvm.lv_present
- Fixed linux_lvm.py modules to have some output even with '-qq'
- Adjusted tests in test_linux_lvm and test_lvm to complies with the
  modifications in linux_lvm module and lvm state. Most of them to
  handle the change from cmd.run to cmd.run_all
2020-08-24 14:48:13 -07:00
piterpunk
48eef6e599 Added LVM pvresize and lvextend to linux_lvm
- Added new functions to linux_lvm.py module
  - lvextend to increase the size of a logical volume and
  - pvresize to resize a physical volume to the current physical
    device size.
2020-08-24 14:48:13 -07:00
piterpunk
9b4edf9980 Cleaning the exceptions trackback in linux_lvm II
- Fixed the tests for pvcreate and pvremove from linux_lvm so
      they didn't expect a trackback as return anymore.
    - The exception trackback cleaning is done.
2020-08-24 14:48:13 -07:00
piterpunk
c8c7c10121 Cleaning the exceptions trackback in linux_lvm.py
- pvcreate and pvremove from linux_lvm execution module raises a
  trackback when they should fail graciously.
- Initial work to remove the trackbacks and substitute then with
  clean failures.
2020-08-24 14:48:13 -07:00
piterpunk
9f44a976b0 Added default answers to lvm.linux_lvm questions
- The LVM commands does a lot of tests before any destructive operation.
  Usually these tests prompts questions and waits for the user answers.
  But the user is not there to answer any of them.
- Some functions in the module have a "force" parameter which defaults
  the answers to "yes". Others have the "yes" hardcoded. And others yet
  have the "force" parameter in examples e documentation but no code to
  handle it.
- Added the "force" parameter on all destructive operations.
- Those functions which previously have the "yes" hardcoded, had the
  "force" parameter defaulted to "True"
- Functions which didn't have the "force" parameter have it defaulted to
  "False" and now the "False" forces all answers to be "no".
- Also, added the parameter "resizefs" to lvm.lvresize
2020-08-24 14:48:13 -07:00
Bryce Larson
37db1d0f4e Improve toml docs 2020-08-24 14:45:54 -07:00
ch3ll
ed79b663c0 skip tests if ssh binary not found 2020-08-24 14:44:51 -07:00
ch3ll
b321137374 Do not lookup reverse dns with salt-ssh 2020-08-24 14:44:51 -07:00
Pedro Algarvio
efc9f30084
Move pytest tests to the right path 2020-08-24 07:50:25 +01:00
Pedro Algarvio
c10d1bad6b
Use pytestmark instead
https://docs.pytest.org/en/latest/reference.html#globalvar-pytestmark
2020-08-24 07:50:24 +01:00
nicholasmhughes
b3127f7648 complying with new tests that were recently added 2020-08-21 16:11:48 -07:00
nicholasmhughes
ccf2cd5f5d fix docstring 2020-08-21 16:11:48 -07:00
nicholasmhughes
7b9e07d42f fix docstring 2020-08-21 16:11:48 -07:00
nicholasmhughes
6562a9bd3e update changelog for 57802 2020-08-21 16:11:48 -07:00
nicholasmhughes
ac482aa60c fixes #57802 broken block_device_mapping type checks 2020-08-21 16:11:48 -07:00
Pedro Algarvio
ed9ebba9bd Freeze napalm test objects 2020-08-21 16:10:55 -07:00
Pedro Algarvio
aed3a3e23a No mocks at the global module scope! 2020-08-21 16:10:39 -07:00
Pedro Algarvio
f7ac35bac1 No global scope prep work! 2020-08-21 16:10:21 -07:00
Pedro Algarvio
65945cac21 Death to globals!
This, at the very minimum, slows down test collection under PyTest.
We should never do computation intensive tasks at the global module scope.
On top of that, using a mutable objects opens up for strange behaviour across
tests since it's not guaranteed that each test will get the exact same,
untouched, object.
2020-08-21 16:09:56 -07:00
Pedro Algarvio
bc5a9f5d18 Add .copy() method to the other immutable classes 2020-08-21 16:09:56 -07:00
Pedro Algarvio
4d7f55c39a
Merge pull request #58259 from saltstack/hotfix/bad-tests-1
Fix duplicate console scripts entry on windows
2020-08-21 07:32:52 +01:00
Pedro Algarvio
9ba8caf26d
Fix duplicate console_scripts entry under windows 2020-08-20 19:31:13 +01:00
Pedro Algarvio
86a86e6b58
Add more insight into failures 2020-08-20 13:46:37 +01:00
Pedro Algarvio
7721f5ca57
Merge pull request #58253 from s0undt3ch/hotfix/bad-tests-1
Remove `napalm` from the windows static requirements
2020-08-20 08:12:04 +01:00
Pedro Algarvio
649f6e2bd3
Remove napalm from the windows static requirements 2020-08-20 00:57:03 +01:00
krionbsd
d680e1a80a Fix broken cron slow test on FreeBSD 2020-08-19 08:16:36 -07:00