Skip to content

Commit 0bd24fe

Browse files
committed
[Feature] added overwrite flag to keyvault command
1 parent 0929347 commit 0bd24fe

3 files changed

Lines changed: 520 additions & 228 deletions

File tree

src/azure-cli/azure/cli/command_modules/keyvault/custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,9 +1460,9 @@ def update_key_rotation_policy(cmd, client, value, key_name=None):
14601460

14611461

14621462
# region KeyVault Secret
1463-
def download_secret(client, file_path, name=None, encoding=None, version=''): # pylint: disable=unused-argument
1463+
def download_secret(client, file_path, name=None, encoding=None, version='', overwrite: bool = False): # pylint: disable=unused-argument
14641464
""" Download a secret from a KeyVault. """
1465-
if os.path.isfile(file_path) or os.path.isdir(file_path):
1465+
if not overwrite and (os.path.isfile(file_path) or os.path.isdir(file_path)):
14661466
raise CLIError("File or directory named '{}' already exists.".format(file_path))
14671467

14681468
secret = client.get_secret(name, version)

0 commit comments

Comments
 (0)