deleteAll: Delete functional version if chassis off

The deleteAll function was skipping to delete the functional
version, which should be allowed if the chassis state is not on.
The erase function already supports that so the user can
individually delete the functional version, just the delete
would not work via the DeleteAll call.

Tested: All PNOR versions, including the functional one, get
deleted at chassis power off via the DeleteAll method.

Change-Id: Ib390545f3ade68e2a3182064549e05994e7f7191
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/item_updater.cpp b/item_updater.cpp
index 76c437c..8ae8549 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -493,9 +493,15 @@
 
 void ItemUpdater::deleteAll()
 {
+    auto chassisOn = isChassisOn();
+
     for (const auto& activationIt : activations)
     {
-        if (!isVersionFunctional(activationIt.first))
+        if (isVersionFunctional(activationIt.first) && chassisOn)
+        {
+            continue;
+        }
+        else
         {
             ItemUpdater::erase(activationIt.first);
         }