Merge pull request #8047 from hashicorp/avoid_panic_when_token_in_azure_builder

azure builder: avoid a panic in getObjectIdFromToken
This commit is contained in:
Adrien Delorme 2019-08-30 11:26:48 +02:00 committed by GitHub
commit c475eb57ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -439,8 +439,9 @@ func getObjectIdFromToken(ui packer.Ui, token *adal.ServicePrincipalToken) strin
ui.Error(fmt.Sprintf("Failed to parse the token,Error: %s", err.Error()))
return ""
}
return claims["oid"].(string)
oid, _ := claims["oid"].(string)
return oid
}
func normalizeAzureRegion(name string) string {