Skip to content

Commit

Permalink
Fix for forwarding rules with nil network and update README.
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Paterson <spaterson@chef.io>
  • Loading branch information
skpaterson committed Jan 4, 2019
1 parent cfeddbc commit 076971a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ The following resources are available in the InSpec GCP Profile
- [google_compute_address](docs/resources/google_compute_address.md)
- [google_compute_firewall](docs/resources/google_compute_firewall.md)
- [google_compute_firewalls](docs/resources/google_compute_firewalls.md)
- [google_compute_forwarding_rule](docs/resources/google_compute_forwarding_rule.md)
- [google_compute_forwarding_rules](docs/resources/google_compute_forwarding_rules.md)
- [google_compute_image](docs/resources/google_compute_image.md)
- [google_compute_instance](docs/resources/google_compute_instance.md)
- [google_compute_instance_group](docs/resources/google_compute_instance_group.md)
Expand Down
3 changes: 2 additions & 1 deletion libraries/google_compute_forwarding_rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ def fetch_data
end
return [] if !@forwarding_rules || !@forwarding_rules.items
@forwarding_rules.items.map do |forwarding_rule|
forwarding_rule_network = forwarding_rule.network.split('/').last if !forwarding_rule.network.nil?
forwarding_rule_rows+=[{ forwarding_rule_id: forwarding_rule.id,
forwarding_rule_name: forwarding_rule.name,
forwarding_rule_network: forwarding_rule.network.split('/').last,
forwarding_rule_network: forwarding_rule_network,
forwarding_rule_load_balancing_scheme: forwarding_rule.load_balancing_scheme }]
end
next_page = @forwarding_rules.next_page_token
Expand Down

0 comments on commit 076971a

Please sign in to comment.