From 8414ab63ac758f5a269c0ad46f66f968e1863539 Mon Sep 17 00:00:00 2001 From: Simon So Date: Fri, 29 Mar 2019 15:20:47 -0700 Subject: [PATCH 1/2] fix KeyError when billing permission requirements are unsatisfied --- .../scripts/preconditions/preconditions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/core_project_factory/scripts/preconditions/preconditions.py b/modules/core_project_factory/scripts/preconditions/preconditions.py index c6539efe..81219a19 100755 --- a/modules/core_project_factory/scripts/preconditions/preconditions.py +++ b/modules/core_project_factory/scripts/preconditions/preconditions.py @@ -286,16 +286,13 @@ def validate(self, credentials): request = service.billingAccounts().testIamPermissions( resource=resource, body=body) - try: - response = request.execute() - except errors.HttpError: - response = {"permissions": []} + response = request.execute() req = Requirements( "Service account permissions on billing account", resource, self.REQUIRED_PERMISSIONS, - response["permissions"], + response.get("permissions", []), ) return req.asdict() From aed9cb7505e621c0dba6bd7327e58be162ac0d73 Mon Sep 17 00:00:00 2001 From: Aaron Lane Date: Mon, 1 Apr 2019 11:37:08 -0400 Subject: [PATCH 2/2] Pin inspec-gcp to v0.10.0 InSpec's support for semantic versioning of git dependencies is currently broken. --- test/integration/shared_vpc_no_subnets/inspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/shared_vpc_no_subnets/inspec.yml b/test/integration/shared_vpc_no_subnets/inspec.yml index 9774ba8a..2b123627 100644 --- a/test/integration/shared_vpc_no_subnets/inspec.yml +++ b/test/integration/shared_vpc_no_subnets/inspec.yml @@ -16,7 +16,7 @@ name: shared_vpc_no_subnets depends: - name: inspec-gcp git: https://github.com/inspec/inspec-gcp.git - version: ~> 0.9.0 + tag: v0.10.0 attributes: - name: project_id required: true