control: Expose fanctl dump option in YAML mode
While the fan control code that uses the YAML configuration doesn't have
any dump capabilities, there are testcases in the
openbmc-test-automation repo that call fanctl dump that don't know if
it's available or not.
This commit just exposes the 'dump' option even in YAML mode so that the
testcase doesn't need to care about fan control's internal
configuration. There was already code that would write the following to
/tmp/fan_control_dump.json in YAML mode:
"msg": "Unable to create dump on non-JSON config based system"
I also changed the help text to a more generic statement about dumping
data debug as opposed to saying it just dumps the flight recorder, since
it does a lot more.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I119b733628402d0719fd42b90254d7072245d080
diff --git a/control/fanctl.cpp b/control/fanctl.cpp
index 39eb4e1..6f4a133 100644
--- a/control/fanctl.cpp
+++ b/control/fanctl.cpp
@@ -527,7 +527,7 @@
}
/**
- * @function dump the FlightRecorder log data
+ * @function dump debug data
*/
void dumpFanControl()
{
@@ -717,14 +717,12 @@
cmdResume->set_help_flag("-h, --help", strHelp);
cmdResume->require_option(0);
-#ifdef CONTROL_USE_JSON
// Dump method
- auto cmdDump = commands->add_subcommand(
- "dump", "Dump the FlightRecorder diagnostic log");
- cmdDump->set_help_flag("-h, --help",
- "Dump the FlightRecorder diagnostic log");
+ auto cmdDump = commands->add_subcommand("dump", "Dump debug data");
+ cmdDump->set_help_flag("-h, --help", "Dump debug data");
cmdDump->require_option(0);
+#ifdef CONTROL_USE_JSON
// Query dump
auto cmdDumpQuery =
commands->add_subcommand("query_dump", "Query the dump file");