Move isFieldModeEnabled to common utility

This commit moves isFieldModeEnabled API from SingleFab class to common
utility. Field mode check is going to be required by upcoming PST
features, and hence this API needs to be an utility API in order to be
accessed throughout the repository.

Change-Id: I3f0024b81493e3284ea0c9ea070e110dc1ef6375
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/src/single_fab.cpp b/vpd-manager/src/single_fab.cpp
index 1f61165..9c4f5ec 100644
--- a/vpd-manager/src/single_fab.cpp
+++ b/vpd-manager/src/single_fab.cpp
@@ -123,29 +123,6 @@
     }
 }
 
-bool SingleFab::isFieldModeEnabled() const noexcept
-{
-    try
-    {
-        std::vector<std::string> l_cmdOutput =
-            commonUtility::executeCmd("/sbin/fw_printenv fieldmode");
-
-        if (l_cmdOutput.size() > 0)
-        {
-            commonUtility::toLower(l_cmdOutput[0]);
-
-            // Remove the new line character from the string.
-            l_cmdOutput[0].erase(l_cmdOutput[0].length() - 1);
-
-            return l_cmdOutput[0] == "fieldmode=true" ? true : false;
-        }
-    }
-    catch (const std::exception& l_ex)
-    {}
-
-    return false;
-}
-
 void SingleFab::updateSystemImValueInVpdToP11Series(
     std::string i_currentImValuePlanar) const noexcept
 {
@@ -183,7 +160,7 @@
 {
     const std::string& l_planarImValue = getImFromPlanar();
     const std::string& l_eBmcImValue = getImFromPersistedLocation();
-    const bool& l_isFieldModeEnabled = isFieldModeEnabled();
+    const bool& l_isFieldModeEnabled = commonUtility::isFieldModeEnabled();
     const bool& l_isLabModeEnabled =
         !l_isFieldModeEnabled;                       // used for understanding
     const bool& l_isPowerVsImage = vpdSpecificUtility::isPowerVsImage();