FAQ | This is a LIVE service | Changelog

Commit 0add5736 authored by Dr Rich Wareham's avatar Dr Rich Wareham
Browse files

HOTFIX: bump to latest secret manager and make setup.py version match CHANGELOG

parent c1295622
Pipeline #114660 failed with stages
in 3 minutes and 20 seconds
......@@ -3,7 +3,7 @@ import os
import urllib.parse
from urllib.request import urlopen
from google.cloud import secretmanager, storage
from google.cloud import secretmanager_v1, storage
import requests
LOG = logging.getLogger(__name__)
......@@ -72,9 +72,9 @@ def _fetch_secret_manager_url(components):
if '/' in secret_name or '/' in version:
raise ValueError('Secret Manager URL must have form sm://PROJECT_ID/SECRET#VERSION')
client = secretmanager.SecretManagerServiceClient()
client = secretmanager_v1.SecretManagerServiceClient()
secret_path = client.secret_version_path(project_id, secret_name, version)
return client.access_secret_version(secret_path).payload.data
return client.access_secret_version(name=secret_path).payload.data
def _fetch_storage_url(components):
......
......@@ -22,7 +22,7 @@ with open("README.md") as fobj:
setup(
name="geddit",
version="0.1.1",
version="1.0.1",
author="University of Cambridge Information Services",
author_email="devops+geddit@uis.cam.ac.uk",
description="Zero-configuration fetching of configuration resources",
......
......@@ -6,7 +6,7 @@ from geddit import geddit
class SecretManagerTestCase(unittest.TestCase):
def setUp(self):
client_patcher = mock.patch('google.cloud.secretmanager.SecretManagerServiceClient')
client_patcher = mock.patch('google.cloud.secretmanager_v1.SecretManagerServiceClient')
self.mock_client_class = client_patcher.start()
self.addCleanup(client_patcher.stop)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment