mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
parent
024f276829
commit
66fdb39fd5
@ -156,6 +156,24 @@ def cas(key, value, old_value):
|
||||
return True
|
||||
|
||||
|
||||
def pop(key, default=None):
|
||||
'''
|
||||
Pop (return & delete) a value from the minion datastore
|
||||
|
||||
.. versionadded:: 2015.5.2
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' data.pop <key> "there was no val"
|
||||
'''
|
||||
store = load()
|
||||
val = store.pop(key, default)
|
||||
dump(store)
|
||||
return val
|
||||
|
||||
|
||||
def get(key, default=None):
|
||||
'''
|
||||
Get a (list of) value(s) from the minion datastore
|
||||
@ -240,21 +258,3 @@ def has_key(key):
|
||||
'''
|
||||
store = load()
|
||||
return key in store
|
||||
|
||||
|
||||
def pop(key, default=None):
|
||||
'''
|
||||
Pop (return & delete) a value from the minion datastore
|
||||
|
||||
.. versionadded:: Beryllium
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' data.pop <key> "there was no val"
|
||||
'''
|
||||
store = load()
|
||||
val = store.pop(key, default)
|
||||
dump(store)
|
||||
return val
|
||||
|
Loading…
Reference in New Issue
Block a user