Browse Source

Merge branch 'master' of dyokunev/openstack-instance-list into master

Илья 1 year ago
parent
commit
6a5fae1e7e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      main.go

+ 4 - 1
main.go

@@ -26,7 +26,10 @@ func main() {
 
 	allServers := getAllServers(computeClient)
 	for _, server := range allServers {
-		addresses := server.Addresses[section.ValueOf("network_name")].([]interface{})
+		addresses, ok := server.Addresses[section.ValueOf("network_name")].([]interface{})
+		if !ok {
+			continue
+		}
 		addressDetails := addresses[0].(map[string]interface{})
 		serverIP := addressDetails["addr"]