Browse Source

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

Илья 4 years ago
parent
commit
22746dcf1c
1 changed files with 1 additions and 8 deletions
  1. 1 8
      main.go

+ 1 - 8
main.go

@@ -24,13 +24,6 @@ func main() {
 	})
 	checkErr(err)
 
-	file, err := os.Create("./instance_list.csv")
-	checkErr(err)
-	defer file.Close()
-
-	_, err = file.WriteString("InstanceID, InstanceIP, InstanceName\n")
-	checkErr(err)
-
 	allServers := getAllServers(computeClient)
 	for _, server := range allServers {
 		addresses := server.Addresses[section.ValueOf("network_name")].([]interface{})
@@ -38,7 +31,7 @@ func main() {
 		serverIP := addressDetails["addr"]
 
 		str := fmt.Sprintf("%v,%v,%v\n", server.ID, serverIP, server.Name)
-		_, err := file.WriteString(str)
+		_, err := os.Stdout.WriteString(str)
 		checkErr(err)
 	}
 }