Skip to content

Commit

Permalink
Key Vault: Flattening out KeyProperties from CertificiatePolicy (Azur…
Browse files Browse the repository at this point in the history
…e#7559)

* moved default policy to a getter in CertificatePolicy

* flattened out KeyProperties

* implemented Charles' comments from previous PR

* fixed pylint errors

* copied over certificate and certificateproperties from master

* ran black on certificates

* implemented Charles' comments
  • Loading branch information
iscai-msft authored and yijxie committed Oct 9, 2019
1 parent 575509d commit b460fa0
Show file tree
Hide file tree
Showing 32 changed files with 1,078 additions and 1,353 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
# ------------------------------------
from .client import CertificateClient
from .enums import ActionType, KeyCurveName, KeyType, SecretContentType, KeyUsageType
from .models import (
AdministratorDetails,
CertificatePolicy,
Contact,
KeyProperties,
LifetimeAction
)
from .models import AdministratorDetails, CertificatePolicy, Contact, LifetimeAction

__all__ = [
"ActionType",
Expand All @@ -20,8 +14,7 @@
"Contact",
"KeyCurveName",
"KeyType",
"KeyProperties",
"KeyUsageType",
"LifetimeAction",
"SecretContentType"
"SecretContentType",
]
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run(self):
while not self.finished():
self._update_status()
time.sleep(self._polling_interval)
if self._pending_certificate_op.status.lower() == 'completed':
if self._pending_certificate_op.status.lower() == "completed":
self._resource = self._get_certificate_command()
else:
self._resource = self._pending_certificate_op
Expand All @@ -43,9 +43,9 @@ def run(self):

def finished(self):
# type: () -> bool
if self._pending_certificate_op.issuer_name.lower() == 'unknown':
if self._pending_certificate_op.issuer_name.lower() == "unknown":
return True
return self._pending_certificate_op.status.lower() != 'inprogress'
return self._pending_certificate_op.status.lower() != "inprogress"

def resource(self):
# type: () -> Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ class AsyncKeyVaultClientBase:
"""Base class for async Key Vault clients"""

@staticmethod
def _create_config(
credential: "TokenCredential", api_version: str = None, **kwargs: "**Any"
) -> Configuration:
def _create_config(credential: "TokenCredential", api_version: str = None, **kwargs: "**Any") -> Configuration:
if api_version is None:
api_version = KeyVaultClient.DEFAULT_API_VERSION
config = KeyVaultClient.get_configuration_class(api_version, aio=True)(credential, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,5 @@
# ------------------------------------

from .client import CertificateClient
from ..enums import ActionType, KeyCurveName, KeyType, SecretContentType, KeyUsageType
from ..models import AdministratorDetails, CertificatePolicy, Contact, KeyProperties, LifetimeAction

__all__ = [
"ActionType",
"AdministratorDetails",
"CertificateClient",
"CertificatePolicy",
"Contact",
"KeyCurveName",
"KeyType",
"KeyProperties",
"KeyUsageType",
"LifetimeAction",
"SecretContentType"
]
__all__ = ["CertificateClient"]
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def run(self) -> None:
while not self.finished():
await self._update_status()
await asyncio.sleep(self._polling_interval)
if self._pending_certificate_op.status.lower() == 'completed':
if self._pending_certificate_op.status.lower() == "completed":
self._resource = await self._get_certificate_command()
else:
self._resource = self._pending_certificate_op
Expand All @@ -42,9 +42,9 @@ async def run(self) -> None:
raise

def finished(self) -> bool:
if self._pending_certificate_op.issuer_name.lower() == 'unknown':
if self._pending_certificate_op.issuer_name.lower() == "unknown":
return True
return self._pending_certificate_op.status.lower() != 'inprogress'
return self._pending_certificate_op.status.lower() != "inprogress"

def resource(self) -> Any:
return self._resource
Expand Down
Loading

0 comments on commit b460fa0

Please sign in to comment.