Skip to content

Commit

Permalink
Fix check in support bundle (#3583) (#3628)
Browse files Browse the repository at this point in the history
Before the upload support bundle direct method, support bundle was only called from the iotedge tool. This made it easy to get the iotedge executable using the first argument. Now that iotedged also calls support bundle, it needs to rely on the path to find the iotedge tool.
  • Loading branch information
lfitchett authored Sep 30, 2020
1 parent b6e2195 commit 45e33a0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion edgelet/support-bundle/src/support_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,14 @@ where
}

fn write_check(mut self) -> Result<Self, Error> {
let iotedge = env::args().next().unwrap();
self.print_verbose("Calling iotedge check");

let mut iotedge = env::args().next().unwrap();
if iotedge.contains("iotedged") {
self.print_verbose("Calling iotedge check from edgelet, using iotedge from path");
iotedge = "iotedge".to_string();
}

let mut check = ShellCommand::new(iotedge);
check.arg("check").args(&["-o", "json"]);

Expand All @@ -397,6 +402,10 @@ where
.write_all(&check.stdout)
.map_err(|err| Error::from(err.context(ErrorKind::SupportBundle)))?;

self.zip_writer
.write_all(&check.stderr)
.map_err(|err| Error::from(err.context(ErrorKind::SupportBundle)))?;

self.print_verbose("Wrote check output to file");
Ok(self)
}
Expand Down

0 comments on commit 45e33a0

Please sign in to comment.