From 3065ef30da280efb586d6c84b06de72487e16c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20D=C3=A1vid?= Date: Wed, 2 Sep 2020 09:14:24 +0300 Subject: [PATCH] device_management.py supports application access keys --- tools/device_management.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/device_management.py b/tools/device_management.py index 7c3d98db332..49ef4108d1f 100644 --- a/tools/device_management.py +++ b/tools/device_management.py @@ -114,17 +114,11 @@ def inner(options): # Get the currently in-use API key (may come from environment or # configuration files, which is handled by the cloud SDK) - api_key_value = accounts.config.get("api_key") - api_key = next(accounts.list_api_keys( - filter={ - "key": api_key_value - } - )) + api_key = accounts.get_api_key("me") certificates_owned = list(certs.list_certificates()) dev_cert_info = None for certif in certificates_owned: - if certif.type == "developer" and (certif.owner_id == api_key.owner_id or - certif.owner_id == api_key.id): + if certif.type == "developer": dev_cert_info = certs.get_certificate(certif.id) LOG.info("Found developer certificate named %s", dev_cert_info.name)