Skip to content

Commit

Permalink
fix : push item to vector
Browse files Browse the repository at this point in the history
  • Loading branch information
karlvlam committed Mar 10, 2017
1 parent 80bc05d commit 9a54210
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ fn main() {
match PROXY_ASG {
"off" => {
println!("Etcd active node not found! Start New Cluster...");
let v: Vec<EtcdMember> = vec![];
let mut v: Vec<EtcdMember> = vec![];
for m in &etcd_ec2_infos {
let i: EtcdMember = EtcdMember {
id: String::new(),
Expand All @@ -181,12 +181,13 @@ fn main() {
peerURLs: vec![format!("{}://{}:{}", PEER_SCHEME, m.privateIp, SERVER_PORT)],
clientURLs: vec![] // dummy
};
v.push(i);
}

println!("Write file to {} ...", &etcd_peers_file_path);

let file_content = gen_etcd_config_file_string(false, &awsid.instanceId, PROXY_ASG,
&etcd_current_members, &awsid.privateIp);
let file_content = gen_etcd_config_file_string(true, &awsid.instanceId, PROXY_ASG,
&v, &awsid.privateIp);
println!("{}", &file_content);
write_string_to_file(&etcd_peers_file_path, &file_content);
exit(0);
Expand Down

0 comments on commit 9a54210

Please sign in to comment.