While trying to get the code complexity down bit some mistakes were
made.
We ONLY should do size conversion when requested! We request it only for
the input values in the zfs and zpool states.
Expand the documentation to clarify that the states/file.exists function will
not create a file when it doesn't exist and returns an error instead.
Fixes#44546.
The output of ```swap -s``` is the same on atleast the following:
- Solaris 11.3
- Solaris 10
- OmniOS
- OpenIndiana
- SmartOS
```
total: 3251464k bytes allocated + 827664k reserved = 4079128k used,
181507256k available
```
The first value is the current allocate mount of swap without
reservations, the 2nd value is the reservation, the 3rd value is the
current used (allocate + reservation) the last value is the amount of
currently available swap.
We want available + used to get the total.
We make sure the values conform to what zfs expects, this should
fix the unneeded updates as mentioned in #44404
Also try and make salt.states.zfs a bit more easier to read.
We make sure the values conform to what zfs expects, this should
fix the unneeded updates as mentioned in #44404
Additional test for zpool.get with whitespaces in the result.
For now _conform_value only does str to num transformation
when it is required. It is possible that in the future it will
also do other things.
So while switching to use stringutils.to_num we kept the old name.
Parsable output needs new unit tests. I update the old tests with fresh
data from one of my test systems and create new tests for the same data
but with the parsable output flag set. These tests also test the new
code that converts numbers to actually numeric values.
Parsable output needs new unit tests. I update the old tests with fresh
data from one of my test systems and create new tests for the same data
but with the parsable output flag set. These tests also test the new
code that converts numbers to actually numeric values.
This commit updates salt.modules.zpool to allow requesting
parsable output for ```zpool.list``` and ```zpool.get```.
This requires for the salt.stats.zpool to be able to correctly
handle multiple ways of formatting values as mentioned in #44404
This commit updates salt.modules.zfs to allow requesting
parsable output for ```zfs.list``` and ```zfs.get```.
This requires for the salt.stats.zfs to be able to correctly
handle multiple ways of formatting values as mentioned in #44404