diff --git a/aws-experiment-launch/experiment/commander/main.go b/aws-experiment-launch/experiment/commander/main.go index 66bd97772..2a34c64e7 100644 --- a/aws-experiment-launch/experiment/commander/main.go +++ b/aws-experiment-launch/experiment/commander/main.go @@ -38,7 +38,6 @@ func readConfigFile() [][]string { if err != nil { log.Fatal("Failed to create local file", err) } - defer out.Close() // get remote config file resp, err := http.Get(setting.configURL) @@ -52,6 +51,7 @@ func readConfigFile() [][]string { if err != nil { log.Fatal("Failed to copy file") } + out.Close() // log config file content, err := ioutil.ReadFile(configFile) @@ -60,6 +60,7 @@ func readConfigFile() [][]string { } log.Println("Successfully downloaded config") log.Println(string(content)) + file, err := os.Open(configFile) defer file.Close() if err != nil { diff --git a/aws-experiment-launch/utils/utils.py b/aws-experiment-launch/utils/utils.py index 771416c38..1236ddb7c 100644 --- a/aws-experiment-launch/utils/utils.py +++ b/aws-experiment-launch/utils/utils.py @@ -141,7 +141,7 @@ def generate_distribution_config(shard_number, client_number, ip_list, distribut with open(distribution_config, "w") as fout: for i in range(len(ip_list)): ip, node_name_tag = ip_list[i].split(" ") - elif leader_id < shard_number: + if leader_id < shard_number: fout.write("%s 9000 leader %d %s\n" % (ip, leader_id, node_name_tag)) leader_id = leader_id + 1 elif validator_id < validator_number: