Remove the key from the cache bank with all the key content. If no key is specified, remove the entire bank with all keys and sub-banks inside.
(bank, key=None)
| 399 | |
| 400 | |
| 401 | def flush(bank, key=None): |
| 402 | """ |
| 403 | Remove the key from the cache bank with all the key content. If no key is specified, remove |
| 404 | the entire bank with all keys and sub-banks inside. |
| 405 | """ |
| 406 | try: |
| 407 | if key is None: |
| 408 | _flush_bank(bank) |
| 409 | else: |
| 410 | _flush_key(bank, key) |
| 411 | except (RedisConnectionError, RedisResponseError) as rerr: |
| 412 | bank_key, _ = _normalize_bank(bank) |
| 413 | if key is None: |
| 414 | mesg = "Cannot flush Redis cache bank {rbank}: {rerr}".format( |
| 415 | rbank=bank_key, |
| 416 | rerr=rerr, |
| 417 | ) |
| 418 | else: |
| 419 | mesg = "Cannot flush Redis cache key {rbank}.{rkey}: {rerr}".format( |
| 420 | rbank=bank_key, |
| 421 | rkey=key, |
| 422 | rerr=rerr, |
| 423 | ) |
| 424 | log.error(mesg) |
| 425 | raise SaltCacheError(mesg) |
| 426 | return True |
| 427 | |
| 428 | |
| 429 | def list_(bank): |
nothing calls this directly
no test coverage detected