Handle presence GPIO read failure

Take post failure action-
if presence GPIO pin couldn't be read
or it says FRU not attached to the slot
or corresponding expander GPIO pin couldn't be updated.

Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
Change-Id: Iff203d9a9eccc95c821e196b3d45e5f6bbd7ed6b
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index ecbe110..2d460d6 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -558,15 +558,27 @@
                              string("\" > /sys/bus/i2c/drivers/at24/bind");
             cout << bindCmd << endl;
             executeCmd(bindCmd);
-        }
 
-        // Check if device showed up (test for file)
-        if (!fs::exists(file))
+            // Check if device showed up (test for file)
+            if (!fs::exists(file))
+            {
+                cerr << "EEPROM " << file
+                     << " does not exist. Take failure action" << endl;
+                // If not, then take failure postAction
+                executePostFailAction(json, file);
+            }
+        }
+        else
         {
-            cout << "EEPROM " << file << " does not exist. Take failure action"
-                 << endl;
-            // If not, then take failure postAction
+            // missing required informations
+            cerr
+                << "VPD inventory JSON missing basic informations of preAction "
+                   "for this FRU : ["
+                << file << "]. Executing executePostFailAction." << endl;
+
+            // Take failure postAction
             executePostFailAction(json, file);
+            return;
         }
     }
 }