Skip to content

Commit

Permalink
[Key Vault] Rename id parameter -> source_id (Azure#18995)
Browse files Browse the repository at this point in the history
  • Loading branch information
mccoyp authored May 28, 2021
1 parent 5235c37 commit ee209c8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def cer(self):
class KeyVaultCertificateIdentifier(object):
"""Information about a KeyVaultCertificate parsed from a certificate ID.
:param str id: the full original identifier of a certificate
:param str source_id: the full original identifier of a certificate
:raises ValueError: if the certificate ID is improperly formatted
Example:
.. literalinclude:: ../tests/test_parse_id.py
Expand All @@ -406,9 +406,9 @@ class KeyVaultCertificateIdentifier(object):
:dedent: 8
"""

def __init__(self, id): # pylint: disable=W0622
def __init__(self, source_id):
# type: (str) -> None
self._resource_id = parse_key_vault_id(id)
self._resource_id = parse_key_vault_id(source_id)

@property
def source_id(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def test_recover_and_purge(self, client, **kwargs):
client.begin_delete_certificate(certificate_name=cert_name).wait()

# validate all our deleted certificates are returned by list_deleted_certificates
deleted = [KeyVaultCertificateIdentifier(id=c.id).name for c in client.list_deleted_certificates()]
deleted = [KeyVaultCertificateIdentifier(source_id=c.id).name for c in client.list_deleted_certificates()]
self.assertTrue(all(c in deleted for c in certs.keys()))

# recover select certificates (test resources have a "livekvtest" prefix)
Expand All @@ -364,7 +364,7 @@ def test_recover_and_purge(self, client, **kwargs):
time.sleep(50)

# validate none of our deleted certificates are returned by list_deleted_certificates
deleted = [KeyVaultCertificateIdentifier(id=c.id).name for c in client.list_deleted_certificates()]
deleted = [KeyVaultCertificateIdentifier(source_id=c.id).name for c in client.list_deleted_certificates()]
self.assertTrue(not any(c in deleted for c in certs.keys()))

# validate the recovered certificates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ async def test_recover_and_purge(self, client, **kwargs):
deleted_certificates = client.list_deleted_certificates()
deleted = []
async for c in deleted_certificates:
deleted.append(KeyVaultCertificateIdentifier(id=c.id).name)
deleted.append(KeyVaultCertificateIdentifier(source_id=c.id).name)
self.assertTrue(all(c in deleted for c in certs.keys()))

# recover select certificates (test resources have a "livekvtest" prefix)
Expand All @@ -368,7 +368,7 @@ async def test_recover_and_purge(self, client, **kwargs):
deleted_certificates = client.list_deleted_certificates()
deleted = []
async for c in deleted_certificates:
deleted.append(KeyVaultCertificateIdentifier(id=c.id).name)
deleted.append(KeyVaultCertificateIdentifier(source_id=c.id).name)
self.assertTrue(not any(c in deleted for c in certs.keys()))

# validate the recovered certificates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def key_operations(self):
class KeyVaultKeyIdentifier(object):
"""Information about a KeyVaultKey parsed from a key ID.
:param str id: the full original identifier of a key
:param str source_id: the full original identifier of a key
:raises ValueError: if the key ID is improperly formatted
Example:
.. literalinclude:: ../tests/test_parse_id.py
Expand All @@ -339,9 +339,9 @@ class KeyVaultKeyIdentifier(object):
:dedent: 8
"""

def __init__(self, id): # pylint: disable=W0622
def __init__(self, source_id):
# type: (str) -> None
self._resource_id = parse_key_vault_id(id)
self._resource_id = parse_key_vault_id(source_id)

@property
def source_id(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def value(self):
class KeyVaultSecretIdentifier(object):
"""Information about a KeyVaultSecret parsed from a secret ID.
:param str id: the full original identifier of a secret
:param str source_id: the full original identifier of a secret
:raises ValueError: if the secret ID is improperly formatted
Example:
.. literalinclude:: ../tests/test_parse_id.py
Expand All @@ -259,9 +259,9 @@ class KeyVaultSecretIdentifier(object):
:dedent: 8
"""

def __init__(self, id): # pylint: disable=W0622
def __init__(self, source_id):
# type: (str) -> None
self._resource_id = parse_key_vault_id(id)
self._resource_id = parse_key_vault_id(source_id)

@property
def source_id(self):
Expand Down

0 comments on commit ee209c8

Please sign in to comment.