Skip to content

Instantly share code, notes, and snippets.

@andytumelty
Created July 17, 2019 13:11
Show Gist options
  • Save andytumelty/9bf7093f441c267e6e96951d6fb53cb2 to your computer and use it in GitHub Desktop.
Save andytumelty/9bf7093f441c267e6e96951d6fb53cb2 to your computer and use it in GitHub Desktop.
import hvac
def move_secret(old_path, new_path, client=None, delete=False):
if not client:
client = hvac.Client()
response = client.secrets.kv.v1.read_secret(path=old_path)
response = client.secrets.kv.v1.create_or_update_secret(path=new_path, secret=response['data'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment