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 93200c2..2a5a873 100644
--- a/dump-extensions/openpower-dumps/dump_manager_system.cpp
+++ b/dump-extensions/openpower-dumps/dump_manager_system.cpp
@@ -139,9 +139,11 @@
         sdbusplus::xyz::openbmc_project::Common::Error::NotAllowed;
     using Reason = xyz::openbmc_project::Common::NotAllowed::REASON;
 
+    auto hostState = phosphor::dump::getHostState();
     // Allow creating system dump only when the host is up.
     if (!(((phosphor::dump::isHostRunning()) ||
-           (phosphor::dump::isHostQuiesced()))))
+           (hostState == phosphor::dump::HostState::Quiesced) ||
+           (hostState == phosphor::dump::HostState::TransitioningToOff))))
     {
         elog<NotAllowed>(
             Reason("System dump can be initiated only when the host is up"));