Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
got rid of adding RUN_IDENTIFIER to vault name
  • Loading branch information
iscai-msft committed Sep 6, 2019
commit 6e73f2eef3c159ecd7b29f117baf03c70b343bfa
28 changes: 0 additions & 28 deletions sdk/keyvault/azure-keyvault-certificates/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,3 @@
collect_ignore_glob = []
if sys.version_info < (3, 5):
collect_ignore_glob.append("tests/*_async.py")

# get the run identifier for unique test runs
dirname = os.path.dirname(os.path.abspath(__file__))
seed_filename = os.path.abspath(os.path.join(dirname, "tests", "seed.txt"))

run_identifier_set = False

try:
with open(seed_filename, "r") as f:
if os.path.getsize(seed_filename):
os.environ['RUN_IDENTIFIER'] = f.readline().strip()
run_identifier_set = True

# if file exists but is empty
if not run_identifier_set:
if "RUN_IDENTIFIER" not in os.environ:
print("Please set your RUN_IDENTIFIER environment variable in seed.txt")
raise NameError
with open(seed_filename, "w") as f:
f.write(os.environ["RUN_IDENTIFIER"])

except FileNotFoundError:
# if file has not yet been created
if "RUN_IDENTIFIER" not in os.environ:
print("Please set your RUN_IDENTIFIER environment variable in seed.txt")
raise NameError
with open(seed_filename, "w") as f:
f.write(os.environ["RUN_IDENTIFIER"])
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ def __init__(
playback_fake_resource=None,
client_kwargs=None,
):
# incorporate a unicode integer representation of run identifier into key vault name for uniqueness
name_prefix += ''.join(str(ord(c)) for c in os.environ['RUN_IDENTIFIER'])[:10]

super(VaultClientPreparer, self).__init__(
name_prefix,
24,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ interactions:
Content-Type: [application/json; charset=utf-8]
User-Agent: [azsdk-python-keyvault-certificates/4.0.0b1 Python/3.6.6 (Windows-10-10.0.18362-SP0)]
method: PUT
uri: https://vault1051159997851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
uri: https://vault851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
response:
body: {string: '{"error":{"code":"Unauthorized","message":"Request is missing
a Bearer or PoP token."}}'}
headers:
cache-control: [no-cache]
content-length: ['87']
content-type: [application/json; charset=utf-8]
date: ['Wed, 04 Sep 2019 23:19:15 GMT']
date: ['Fri, 06 Sep 2019 18:03:30 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-IIS/10.0]
Expand All @@ -26,9 +26,9 @@ interactions:
resource="https://vault.azure.net"']
x-aspnet-version: [4.0.30319]
x-content-type-options: [nosniff]
x-ms-keyvault-network-info: [addr=131.107.160.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-network-info: [addr=131.107.174.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-region: [westus]
x-ms-keyvault-service-version: [1.1.0.876]
x-ms-keyvault-service-version: [1.1.0.878]
x-powered-by: [ASP.NET]
status: {code: 401, message: Unauthorized}
- request:
Expand All @@ -43,24 +43,24 @@ interactions:
Content-Type: [application/json; charset=utf-8]
User-Agent: [azsdk-python-keyvault-certificates/4.0.0b1 Python/3.6.6 (Windows-10-10.0.18362-SP0)]
method: PUT
uri: https://vault1051159997851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
uri: https://vault851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
response:
body: {string: '{"id":"https://vault1051159997851e11ad.vault.azure.net/certificates/contacts","contacts":[{"email":"[email protected]","name":"John
body: {string: '{"id":"https://vault851e11ad.vault.azure.net/certificates/contacts","contacts":[{"email":"[email protected]","name":"John
Doe","phone":"1111111111"},{"email":"[email protected]","name":"John Doe2","phone":"2222222222"}]}'}
headers:
cache-control: [no-cache]
content-length: ['231']
content-length: ['221']
content-type: [application/json; charset=utf-8]
date: ['Wed, 04 Sep 2019 23:19:16 GMT']
date: ['Fri, 06 Sep 2019 18:03:31 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-IIS/10.0]
strict-transport-security: [max-age=31536000;includeSubDomains]
x-aspnet-version: [4.0.30319]
x-content-type-options: [nosniff]
x-ms-keyvault-network-info: [addr=131.107.160.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-network-info: [addr=131.107.174.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-region: [westus]
x-ms-keyvault-service-version: [1.1.0.876]
x-ms-keyvault-service-version: [1.1.0.878]
x-powered-by: [ASP.NET]
status: {code: 200, message: OK}
- request:
Expand All @@ -71,24 +71,24 @@ interactions:
Connection: [keep-alive]
User-Agent: [azsdk-python-keyvault-certificates/4.0.0b1 Python/3.6.6 (Windows-10-10.0.18362-SP0)]
method: GET
uri: https://vault1051159997851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
uri: https://vault851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
response:
body: {string: '{"id":"https://vault1051159997851e11ad.vault.azure.net/certificates/contacts","contacts":[{"email":"[email protected]","name":"John
body: {string: '{"id":"https://vault851e11ad.vault.azure.net/certificates/contacts","contacts":[{"email":"[email protected]","name":"John
Doe","phone":"1111111111"},{"email":"[email protected]","name":"John Doe2","phone":"2222222222"}]}'}
headers:
cache-control: [no-cache]
content-length: ['231']
content-length: ['221']
content-type: [application/json; charset=utf-8]
date: ['Wed, 04 Sep 2019 23:19:16 GMT']
date: ['Fri, 06 Sep 2019 18:03:31 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-IIS/10.0]
strict-transport-security: [max-age=31536000;includeSubDomains]
x-aspnet-version: [4.0.30319]
x-content-type-options: [nosniff]
x-ms-keyvault-network-info: [addr=131.107.160.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-network-info: [addr=131.107.174.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-region: [westus]
x-ms-keyvault-service-version: [1.1.0.876]
x-ms-keyvault-service-version: [1.1.0.878]
x-powered-by: [ASP.NET]
status: {code: 200, message: OK}
- request:
Expand All @@ -100,24 +100,24 @@ interactions:
Content-Length: ['0']
User-Agent: [azsdk-python-keyvault-certificates/4.0.0b1 Python/3.6.6 (Windows-10-10.0.18362-SP0)]
method: DELETE
uri: https://vault1051159997851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
uri: https://vault851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
response:
body: {string: '{"id":"https://vault1051159997851e11ad.vault.azure.net/certificates/contacts","contacts":[{"email":"[email protected]","name":"John
body: {string: '{"id":"https://vault851e11ad.vault.azure.net/certificates/contacts","contacts":[{"email":"[email protected]","name":"John
Doe","phone":"1111111111"},{"email":"[email protected]","name":"John Doe2","phone":"2222222222"}]}'}
headers:
cache-control: [no-cache]
content-length: ['231']
content-length: ['221']
content-type: [application/json; charset=utf-8]
date: ['Wed, 04 Sep 2019 23:19:16 GMT']
date: ['Fri, 06 Sep 2019 18:03:31 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-IIS/10.0]
strict-transport-security: [max-age=31536000;includeSubDomains]
x-aspnet-version: [4.0.30319]
x-content-type-options: [nosniff]
x-ms-keyvault-network-info: [addr=131.107.160.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-network-info: [addr=131.107.174.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-region: [westus]
x-ms-keyvault-service-version: [1.1.0.876]
x-ms-keyvault-service-version: [1.1.0.878]
x-powered-by: [ASP.NET]
status: {code: 200, message: OK}
- request:
Expand All @@ -128,23 +128,23 @@ interactions:
Connection: [keep-alive]
User-Agent: [azsdk-python-keyvault-certificates/4.0.0b1 Python/3.6.6 (Windows-10-10.0.18362-SP0)]
method: GET
uri: https://vault1051159997851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
uri: https://vault851e11ad.vault.azure.net/certificates/contacts?api-version=7.0
response:
body: {string: '{"error":{"code":"ContactsNotFound","message":"Contacts not found"}}'}
headers:
cache-control: [no-cache]
content-length: ['68']
content-type: [application/json; charset=utf-8]
date: ['Wed, 04 Sep 2019 23:19:16 GMT']
date: ['Fri, 06 Sep 2019 18:03:31 GMT']
expires: ['-1']
pragma: [no-cache]
server: [Microsoft-IIS/10.0]
strict-transport-security: [max-age=31536000;includeSubDomains]
x-aspnet-version: [4.0.30319]
x-content-type-options: [nosniff]
x-ms-keyvault-network-info: [addr=131.107.160.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-network-info: [addr=131.107.174.72;act_addr_fam=InterNetwork;]
x-ms-keyvault-region: [westus]
x-ms-keyvault-service-version: [1.1.0.876]
x-ms-keyvault-service-version: [1.1.0.878]
x-powered-by: [ASP.NET]
status: {code: 404, message: Not Found}
version: 1
Loading