diff options
author | Dmitry Tantsur <dtantsur@protonmail.com> | 2019-11-11 16:03:59 +0100 |
---|---|---|
committer | Steve Baker <sbaker@redhat.com> | 2021-03-24 11:11:07 +1300 |
commit | 045bcfef32e4ab679678500d2a58c92398ad838c (patch) | |
tree | b07730870918ff0e2ebc724125c1dda62227985f | |
parent | 10059c535fe7b77d8d73918ca1316cfcc856b351 (diff) | |
download | ironic-python-agent-045bcfef32e4ab679678500d2a58c92398ad838c.tar.gz |
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 1d12505fa069bef886ee908a83920aa2afa44298)
-rw-r--r-- | ironic_python_agent/extensions/image.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py index a8e2f27c..6c6ba496 100644 --- a/ironic_python_agent/extensions/image.py +++ b/ironic_python_agent/extensions/image.py @@ -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. |