diff --git a/automation/taskcluster/helper/get-secret.py b/automation/taskcluster/helper/get-secret.py index 972c5fc2e..8dd9f3d5a 100644 --- a/automation/taskcluster/helper/get-secret.py +++ b/automation/taskcluster/helper/get-secret.py @@ -12,6 +12,12 @@ import taskcluster def write_secret_to_file(path, data, key, base64decode=False, json_secret=False, append=False, prefix=''): path = os.path.join(os.path.dirname(__file__), '../../../' + path) + try: + os.makedirs(os.path.dirname(path)) + except OSError as error: + if error.errno != errno.EEXIST: + raise + with open(path, 'a' if append else 'w') as f: value = data['secret'][key] if base64decode: