From e0de0b1dd5e6e5a3a7e00fab96524bc2916bfd01 Mon Sep 17 00:00:00 2001 From: drewmullen Date: Fri, 22 Mar 2024 16:17:13 -0400 Subject: [PATCH] Update kv_recursive.py --- kv_recursive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kv_recursive.py b/kv_recursive.py index bd37641..5a757f6 100644 --- a/kv_recursive.py +++ b/kv_recursive.py @@ -65,7 +65,7 @@ def read_secrets_from_list(client, kv_list, kv_version, source_mount): for i, li in enumerate(kv_list[:]): k = kv_list[i] if kv_version == 2: - v = client.secrets.kv.v2.read_secret_version(k, mount_point=source_mount, + v = client.secrets.kv.v2.read_secret_version(k, mount_point=source_mount, raise_on_deleted_version=True)['data']['data'] elif kv_version == 1: v = client.secrets.kv.v1.read_secret(k, mount_point=source_mount)['data'] @@ -125,7 +125,7 @@ def main(): if __name__ == '__main__': parser = argparse.ArgumentParser(description='Recursively interact with Hashicorp Vault KV mount') - parser.add_argument('action', choices=['copy', 'move', 'delete', 'list', 'read', + parser.add_argument('action', choices=['copy', 'move', 'delete', 'list', 'read', 'count'], default='list', metavar='ACTION') parser.add_argument('--tls-skip-verify', action='store_false') parser.add_argument('--source-path', '-s', default='')