Skip to content

Commit

Permalink
add module namespace
Browse files Browse the repository at this point in the history
Fixes:

    $ vault_from_gpg_agent.py
    Traceback (most recent call last):
      File "/usr/local/bin/vault_from_gpg_agent.py", line 96, in <module>
        main()
      File "/usr/local/bin/vault_from_gpg_agent.py", line 92, in main
        get_passphrase(gpg_agent, my_path, cache_id)
      File "/usr/local/bin/vault_from_gpg_agent.py", line 53, in get_passphrase
        description = urllib.quote(
    AttributeError: module 'urllib' has no attribute 'quote'
  • Loading branch information
tpo committed Feb 16, 2021
1 parent f9ff042 commit cc647e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vault_from_gpg_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
import subprocess
import sys
import urllib
import urllib.parse
import os.path
import hashlib
import base64
import argparse


def get_passphrase(gpg_agent, my_path, cache_id):
description = urllib.quote(
description = urllib.parse.quote(
"Please enter the ansible vault password for %s" % (my_path,))
command = "GET_PASSPHRASE %s X X %s\n" % (cache_id, description)
stdout = gpg_agent.communicate(command)[0]
Expand Down

0 comments on commit cc647e0

Please sign in to comment.