mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
doc & merge fix
Fix doc & potential merge conflict w/#24168
This commit is contained in:
parent
eba382cdda
commit
2175ff3c75
1 changed files with 6 additions and 7 deletions
|
@ -151,20 +151,19 @@ def cas(key, value, old_value):
|
|||
return True
|
||||
|
||||
|
||||
def pop(key):
|
||||
def pop(key, default=None):
|
||||
'''
|
||||
Return & remove a value from the minion datastore
|
||||
Pop (return & delete) a value from the minion datastore
|
||||
|
||||
.. versionadded:: 2015.5.2
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' data.pop <key>
|
||||
salt '*' data.pop <key> "there was no val"
|
||||
'''
|
||||
store = load()
|
||||
val = None
|
||||
if key in store:
|
||||
val = store.pop(key)
|
||||
val = store.pop(key, default)
|
||||
dump(store)
|
||||
|
||||
return val
|
||||
|
|
Loading…
Add table
Reference in a new issue