gooftool: More fix for HasFpmcu()
HasFpmcu() is currently broken, because for the boards without FPMCU,
'cros_config fingerprint board' returns an empty string but still
succeeds.
BUG=b:145560202
TEST=make test
TEST=manually run finalization on a board with FPS and another board
without FPS.
Change-Id: I015cd72ad8fd8b2680431828d221f5bbfdc54724
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/factory/+/1948163
Reviewed-by: Yong Hong <yhong@chromium.org>
Reviewed-by: Alex Chou <alex.chou@quanta.corp-partner.google.com>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 6af25a2..4934b92 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -25,7 +25,6 @@
import xmlrpclib
from six import iteritems
-from six.moves import xrange
import factory_common # pylint: disable=unused-import
from cros.factory.gooftool.common import ExecFactoryPar
@@ -82,7 +81,8 @@
FPMCU_PATH = '/dev/cros_fp'
has_fpmcu_path = os.path.exists(FPMCU_PATH)
has_cros_config_fpmcu = False
- if Shell(['cros_config', '/fingerprint', 'board']).success:
+ cros_config_output = Shell(['cros_config', '/fingerprint', 'board'])
+ if cros_config_output.success and cros_config_output.stdout:
has_cros_config_fpmcu = True
if has_fpmcu_path is False and has_cros_config_fpmcu is True: