Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
fix naming and error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
chkeita committed Oct 25, 2021
1 parent 21e3717 commit 7f55dd0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/deployment/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,13 @@ def assign_app_role_manually(
raise Exception("onefuzz app service principal not found")
onefuzz_service_principal = onefuzz_service_principals[0]

scaleset_service_principals: List[ServicePrincipal] = list(
application_service_principals: List[ServicePrincipal] = list(
client.service_principals.list(filter="displayName eq '%s'" % application_name)
)

if not scaleset_service_principals:
raise Exception("scaleset service principal not found")
scaleset_service_principal = scaleset_service_principals[0]
if not application_service_principals:
raise Exception("application service principal not found")
scaleset_service_principal = application_service_principals[0]

scaleset_service_principal.app_roles
app_roles: List[AppRole] = [
Expand Down Expand Up @@ -545,14 +545,14 @@ def assign_app_role(
if len(onefuzz_service_principals["value"]) == 0:
raise Exception("onefuzz app service principal not found")
onefuzz_service_principal = onefuzz_service_principals["value"][0]
scaleset_service_principals = query_microsoft_graph(
application_service_principals = query_microsoft_graph(
method="GET",
resource="servicePrincipals",
params={"$filter": "displayName eq '%s'" % application_name},
)
if len(scaleset_service_principals["value"]) == 0:
raise Exception("scaleset service principal not found")
scaleset_service_principal = scaleset_service_principals["value"][0]
if len(application_service_principals["value"]) == 0:
raise Exception("application service principal not found")
scaleset_service_principal = application_service_principals["value"][0]
managed_node_role = (
seq(onefuzz_service_principal["appRoles"])
.filter(lambda x: x["value"] == app_role.value)
Expand Down

0 comments on commit 7f55dd0

Please sign in to comment.