Skip to content

Commit

Permalink
Merge pull request #2136 from habitat-sh/eventsrv-config-data
Browse files Browse the repository at this point in the history
Approved by: @nobody from Nowhere
Merged by: The Sentinels
  • Loading branch information
thesentinels authored Apr 20, 2017
2 parents 93a0a8e + 3ec2bbf commit 1393008
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion components/eventsrv-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ impl EventSrvClient {
}
}

// connect to an external process
pub fn connect(&self) {
for p in &self.ports {
let push_connect = format!("tcp://localhost:{}", p);
Expand Down
3 changes: 3 additions & 0 deletions components/eventsrv/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ fn main() {
let data = parse_from_bytes::<CensusEntryProto>(&payload_buf).unwrap();
println!("SUBSCRIBER: Census Entry Member ID {}",
data.get_member_id());
let cfg = data.get_cfg().to_vec();
let cfg_str = String::from_utf8(cfg).unwrap();
println!("SUBSCRIBER: Census Entry Config {}", cfg_str);

}
EventEnvelope_Type::JSON |
Expand Down
5 changes: 2 additions & 3 deletions components/sup/src/manager/census.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,8 @@ impl CensusEntry {
cep.set_group(self.group.clone());
cep.set_org(String::from(self.get_org()));

// JB TODO: cfg needs to be converted from a toml::Table::Value into a string first, then
// from a string to bytes.
// cep.set_cfg()
let cfg_str = toml::to_string(&self.cfg).unwrap();
cep.set_cfg(cfg_str.into_bytes());

let mut sys_info = SysInfoProto::new();
sys_info.set_ip(self.sys.ip.clone());
Expand Down
2 changes: 1 addition & 1 deletion components/sup/src/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl Manager {
ee.set_field_type(EventEnvelope_Type::ProtoBuf);
ee.set_payload(payload_buf);
ee.set_member_id(member_id);
ee.set_service("habitat-supervisor".to_string());
ee.set_service("habitat-sup".to_string());
let _ = client.send(ee);
Ok(())
}
Expand Down

0 comments on commit 1393008

Please sign in to comment.