Skip to content

Commit c6fef82

Browse files
author
Cruz Monrreal
authored
Merge pull request #8079 from bremoran/patch-3
BUGFIX: Remove account management API calls from DM
2 parents 8d9e2e5 + 989f394 commit c6fef82

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tools/device_management.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,22 @@ def inner(options):
8585
api_key = accounts.list_api_keys(filter={
8686
'key': getenv("MBED_CLOUD_SDK_API_KEY")
8787
}).next()
88-
user = accounts.get_user(api_key.owner_id)
8988
certificates_owned = list(certs.list_certificates())
9089
dev_cert_info = None
9190
for certif in certificates_owned:
92-
if certif.type == "developer" and (certif.owner_id == user.id or
91+
if certif.type == "developer" and (certif.owner_id == api_key.owner_id or
9392
certif.owner_id == api_key.id):
9493
dev_cert_info = certs.get_certificate(certif.id)
95-
LOG.info("Found developer certificate onwed by %s named %s",
96-
user.full_name, dev_cert_info.name)
94+
LOG.info("Found developer certificate named %s",
95+
dev_cert_info.name)
9796
break
9897
else:
9998
LOG.warning(
10099
"Could not find developer certificate for this account."
101100
" Generting a new developer certificate."
102101
)
103102
dev_cert_info = CertificatesAPI().add_developer_certificate(
104-
"mbed-cli-auto {}".format(user.full_name),
103+
"mbed-cli-auto {}".format(api_key.name),
105104
description="cetificate auto-generated by Mbed CLI"
106105
)
107106
LOG.info("Writing developer certificate %s into c file "

0 commit comments

Comments
 (0)