MCPcopy
hub / github.com/saltstack/salt / delval

Function delval

salt/modules/grains.py:451–475  ·  view source on GitHub ↗

.. versionadded:: 0.17.0 Delete a grain value from the grains config file. This will just set the grain value to ``None``. To completely remove the grain, run ``grains.delkey`` or pass ``destructive=True`` to ``grains.delval``. key The grain key from which to delete th

(key, destructive=False, force=False)

Source from the content-addressed store, hash-verified

449
450
451def delval(key, destructive=False, force=False):
452 """
453 .. versionadded:: 0.17.0
454
455 Delete a grain value from the grains config file. This will just set the
456 grain value to ``None``. To completely remove the grain, run ``grains.delkey``
457 or pass ``destructive=True`` to ``grains.delval``.
458
459 key
460 The grain key from which to delete the value.
461
462 destructive
463 Delete the key, too. Defaults to False.
464
465 force
466 Force remove the grain even when it is a mapped value.
467 Defaults to False
468
469 CLI Example:
470
471 .. code-block:: bash
472
473 salt '*' grains.delval key
474 """
475 return set(key, None, destructive=destructive, force=force)
476
477
478def ls(): # pylint: disable=C0103

Callers 1

delkeyFunction · 0.85

Calls 1

setFunction · 0.70

Tested by

no test coverage detected