OpenPOWER: Allow system dump in TransitioningToOff state

There are cases the host can be stuck in the
TransitioningToOff state, a system dump from that
state is needed for further debug on host side.

Tests:
Initiate dump when system is in TransitioningToOff state

Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: I59b4e5710453fd87bec5de17af35f5d5064ebdf1
diff --git a/dump-extensions/openpower-dumps/dump_manager_system.cpp b/dump-extensions/openpower-dumps/dump_manager_system.cpp
index e828371..19fb1b5 100644
--- a/dump-extensions/openpower-dumps/dump_manager_system.cpp
+++ b/dump-extensions/openpower-dumps/dump_manager_system.cpp
@@ -170,14 +170,17 @@
         return std::string();
     }
     bool isHostQuiesced = hostState == phosphor::dump::HostState::Quiesced;
+    bool isHostTransitioningToOff =
+        hostState == phosphor::dump::HostState::TransitioningToOff;
     // Allow creating system dump only when the host is up or quiesced
-    if (!isHostRunning && !isHostQuiesced)
+    // starting to power off
+    if (!isHostRunning && !isHostQuiesced && !isHostTransitioningToOff)
     {
         lg2::error("System dump can be initiated only when the host is up "
-                   "or quiesced");
+                   "or quiesced or starting to poweroff");
         elog<NotAllowed>(
             Reason("System dump can be initiated only when the host is up "
-                   "or quiesced"));
+                   "or quiesced or starting to poweroff"));
         return std::string();
     }