repair: Stop parsing VPD cache
Companion change to:
https://chromium-review.googlesource.com/c/infra/infra/+/5185328
`vpd -g ...` is enough to retrieve this value. We're going to remove the
dump_vpd_log cache eventually.
BUG=b:77594752
TEST=none
Change-Id: Ie70c392f24a68ec7200725ee41cf38af11e38571
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/moblab/+/5191666
Reviewed-by: Varun Thammineni <varunth@google.com>
Commit-Queue: Varun Thammineni <varunth@google.com>
Tested-by: Varun Thammineni <varunth@google.com>
diff --git a/third_party/autotest/server/hosts/cros_repair.py b/third_party/autotest/server/hosts/cros_repair.py
index b6eec86..29ac4ac 100644
--- a/third_party/autotest/server/hosts/cros_repair.py
+++ b/third_party/autotest/server/hosts/cros_repair.py
@@ -581,6 +581,8 @@
# update serial_number for VPD
cmd = 'vpd -s serial_number=%s'
host.run(cmd % serial_number, ignore_status=True)
+ # TODO(b/77594752): remove once dump_vpd_log consumers are
+ # gone.
host.run('dump_vpd_log --force', ignore_status=True)
# reading from VPD to see what we updated
req = host.run('vpd -g serial_number', ignore_status=True)
@@ -606,8 +608,8 @@
/home/.shadow/install_attributes.pb
Flag 2 - The value of "check_enrollment" from VPD. Can be obtained by
- reading the cache file in
- /mnt/stateful_partition/unencrypted/cache/vpd/full-v2.txt
+ running
+ vpd -g check_enrollment -i RW_VPD
The states:
State 1 - Device is enrolled, means flag 1 is true and in
@@ -637,12 +639,12 @@
def _get_enrollment_state(self, host):
logging.debug('checking enrollment state from VPD cache...')
- response = host.run('grep "check_enrollment" %s' % self.VPD_CACHE,
+ response = host.run('vpd -g check_enrollment -i RW_VPD',
ignore_status=True)
if response.exit_status == 0:
result = response.stdout.strip()
logging.info('Enrollment state in VPD cache: %s', result)
- return result == '"check_enrollment"="1"'
+ return result == '1'
logging.error('Unexpected error occured during verify enrollment state'
' in VPD cache, skipping verify process.')