Fix bug when checking if the default cli application exists (#488)

This commit is contained in:
Cheick Keita 2021-01-29 12:32:17 -08:00 committed by GitHub
parent 0a1021447b
commit cc1c79b27d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -328,11 +328,11 @@ class Client:
(password_id, password) = self.create_password(app.object_id)
cli_app = client.applications.list(filter="appId eq '%s'" % ONEFUZZ_CLI_APP)
cli_app = list(
client.applications.list(filter="appId eq '%s'" % ONEFUZZ_CLI_APP)
)
onefuzz_cli_app_uuid = uuid.UUID(ONEFUZZ_CLI_APP)
if not cli_app:
if len(cli_app) == 0:
logger.info(
"Could not find the default CLI application under the current "
"subscription, creating a new one"
@ -346,7 +346,7 @@ class Client:
}
else:
authorize_application(onefuzz_cli_app_uuid, app.app_id)
authorize_application(uuid.UUID(ONEFUZZ_CLI_APP), app.app_id)
self.results["client_id"] = app.app_id
self.results["client_secret"] = password