Document parameters in modules.disk

This commit is contained in:
James Howe 2023-10-05 10:22:58 +01:00 committed by Daniel Wozniak
parent 6b7377799d
commit da081c0ddb

View file

@ -66,6 +66,7 @@ def _clean_flags(args, caller):
flags = ""
if args is None:
return flags
# TODO: most of these cause the result parsing to fail
allowed = ("a", "B", "h", "H", "i", "k", "l", "P", "t", "T", "x", "v")
for flag in args:
if flag in allowed:
@ -79,6 +80,9 @@ def usage(args=None):
"""
Return usage information for volumes mounted on this minion
args
Sequence of flags to pass to the ``df`` command.
.. versionchanged:: 2019.2.0
Default for SunOS changed to 1 kilobyte blocks
@ -160,6 +164,9 @@ def inodeusage(args=None):
"""
Return inode usage information for volumes mounted on this minion
args
Sequence of flags to pass to the ``df`` command.
CLI Example:
.. code-block:: bash
@ -218,6 +225,9 @@ def percent(args=None):
"""
Return partition information for volumes mounted on this minion
args
Specify a single partition for which to return data.
CLI Example:
.. code-block:: bash
@ -379,6 +389,12 @@ def dump(device, args=None):
"""
Return all contents of dumpe2fs for a specified device
device
The device path to dump.
args
A list of attributes to return. Returns all by default.
CLI Example:
.. code-block:: bash
@ -572,24 +588,25 @@ def _hdparm(args, failhard=True):
@salt.utils.decorators.path.which("hdparm")
def hdparms(disks, args=None):
def hdparms(disks, args="aAbBcCdgHiJkMmNnQrRuW"):
"""
Retrieve all info's for all disks
parse 'em into a nice dict
(which, considering hdparms output, is quite a hassle)
Retrieve disk parameters.
.. versionadded:: 2016.3.0
disks
Single disk or list of disks to query.
args
Sequence of ``hdparm`` flags to fetch.
CLI Example:
.. code-block:: bash
salt '*' disk.hdparms /dev/sda
"""
all_parms = "aAbBcCdgHiJkMmNnQrRuW"
if args is None:
args = all_parms
elif isinstance(args, (list, tuple)):
if isinstance(args, (list, tuple)):
args = "".join(args)
if not isinstance(disks, (list, tuple)):