Skip to content

Commit

Permalink
Run mypy in azure-keyvault-certificates CI (#20525)
Browse files Browse the repository at this point in the history
  • Loading branch information
YalinLi0312 authored Sep 8, 2021
1 parent 10979de commit 63d21c5
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 123 deletions.
1 change: 1 addition & 0 deletions eng/tox/mypy_hard_failure_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"azure-eventhub",
"azure-identity",
"azure-keyvault-administration",
"azure-keyvault-certificates",
"azure-servicebus",
"azure-ai-textanalytics",
"azure-ai-formrecognizer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def begin_create_certificate(self, certificate_name, policy, **kwargs):
create_certificate_polling = CreateCertificatePoller(
get_certificate_command=get_certificate_command, interval=polling_interval
)
return LROPoller(command, create_certificate_operation, None, create_certificate_polling)
return LROPoller(command, create_certificate_operation, lambda *_: None, create_certificate_polling)

@distributed_trace
def get_certificate(self, certificate_name, **kwargs):
Expand Down Expand Up @@ -668,13 +668,15 @@ def set_contacts(self, contacts, **kwargs):
:caption: Create contacts
:dedent: 8
"""
contacts = self._client.set_certificate_contacts(
new_contacts = self._client.set_certificate_contacts(
vault_base_url=self.vault_url,
contacts=self._models.Contacts(contact_list=[c._to_certificate_contacts_item() for c in contacts]),
error_map=_error_map,
**kwargs
)
return [CertificateContact._from_certificate_contacts_item(contact_item=item) for item in contacts.contact_list]
return [
CertificateContact._from_certificate_contacts_item(contact_item=item) for item in new_contacts.contact_list
]

@distributed_trace
def get_contacts(self, **kwargs):
Expand Down Expand Up @@ -885,7 +887,7 @@ def create_issuer(self, issuer_name, provider, **kwargs):
phone=contact.phone,
)
for contact in admin_contacts
]
] # type: Optional[List[Any]]
else:
admin_details = None
if organization_id or admin_details:
Expand Down Expand Up @@ -946,7 +948,7 @@ def update_issuer(self, issuer_name, **kwargs):
phone=contact.phone,
)
for contact in admin_contacts
]
] # type: Optional[List[Any]]
else:
admin_details = None
if organization_id or admin_details:
Expand Down
Loading

0 comments on commit 63d21c5

Please sign in to comment.