Skip to content

Commit

Permalink
Allow errors from new ipmitool
Browse files Browse the repository at this point in the history
  • Loading branch information
Bownairo committed Sep 18, 2024
1 parent c123dd7 commit 5ab370e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion rs/ic_os/network/src/mac_address.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::process::Command;

use anyhow::{bail, Context, Result};
use regex::Regex;
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -131,7 +133,17 @@ pub fn generate_mac_address(
);
Ok(mgmt_mac)
} else {
let ipmitool_output = get_command_stdout("ipmitool", ["lan", "print"])?;
// A bug in our version of ipmitool causes it to exit with an error
// status, but we have enough output to work with anyway.
// https://github.com/ipmitool/ipmitool/issues/388

// let ipmitool_output = get_command_stdout("ipmitool", ["lan", "print"])?;
let output = Command::new("ipmitool").arg("lan").arg("print").output()?;
if !output.status.success() {
warn!("Error running ipmitool: {}", str::from_utf8(output.stderr));
}
let ipmitool_output = String::from_utf8(output.stdout)?;

get_mac_address_from_ipmitool_output(&ipmitool_output)
}?;
generate_mac_address_internal(&mgmt_mac, deployment_name, node_type, '6')
Expand Down

0 comments on commit 5ab370e

Please sign in to comment.