Browse Source

Do not try to read raw disk data as unicode

Fixes regression in commit 9f8fa2853af00045118ccd44180e7053e6d027af:
utils.execute returns unicode by default, but this data is binary.

Change-Id: I5b54c1f6cfac5fff672245c523b9fb647478edbd
(cherry picked from commit 1d12505fa0)
changes/81/782881/1
Dmitry Tantsur 1 year ago
committed by Steve Baker
parent
commit
045bcfef32
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      ironic_python_agent/extensions/image.py

+ 1
- 1
ironic_python_agent/extensions/image.py View File

@ -159,7 +159,7 @@ def _is_bootloader_loaded(dev):
if 'boot sector' in stdout:
# Now lets check the signature
ddout, dderr = utils.execute(
'dd', 'if=%s' % device, 'bs=218', 'count=1')
'dd', 'if=%s' % device, 'bs=218', 'count=1', binary=True)
stdout, stderr = utils.execute('file', '-', process_input=ddout)
# The bytes recovered by dd show as a "dos executable" when
# examined with file. In other words, the bootloader is present.


Loading…
Cancel
Save