Fixed null pointer panic during firewall rules test

This commit is contained in:
Brett Mack 2015-11-17 10:44:50 +00:00
parent cc54785b1c
commit f140c15039
1 changed files with 4 additions and 1 deletions

View File

@ -78,7 +78,10 @@ func createFirewallRulesConfigs(existingRules *govcd.EdgeGateway) string {
Href: os.Getenv("VCD_URL"),
VDC: os.Getenv("VCD_VDC"),
}
conn, _ := config.Client()
conn, err := config.Client()
if err != nil {
return fmt.Sprintf(testAccCheckVcdFirewallRules_add, "", "")
}
edgeGateway, _ := conn.OrgVdc.FindEdgeGateway(os.Getenv("VCD_EDGE_GATWEWAY"))
*existingRules = edgeGateway
log.Printf("[DEBUG] Edge gateway: %#v", edgeGateway)