Skip to content

Commit 9b932e7

Browse files
committed
Fixed grub verify_image_sign print
1 parent cb08153 commit 9b932e7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

sonic_installer/bootloader/grub.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ def is_secure_upgrade_image_verification_supported(self):
173173
fi
174174
exit 0
175175
'''
176-
verification_result = subprocess.run(['bash', '-c', check_if_verification_is_enabled_and_supported_code], check=True, capture_output=True)
177-
click.echo(str(verification_result.stdout) + " " + str(verification_result.stderr))
176+
verification_result = subprocess.run(['bash', '-c', check_if_verification_is_enabled_and_supported_code], check=True, capture_output=True, stderr=subprocess.STDOUT)
177+
click.echo(verification_result.stdout.decode())
178178
return verification_result.returncode == 0
179179

180180
def verify_image_sign(self, image_path):
@@ -184,8 +184,8 @@ def verify_image_sign(self, image_path):
184184
if not os.path.exists(script_path):
185185
click.echo("Unable to find verification script in path " + script_path)
186186
return False
187-
verification_result = subprocess.run([script_path, image_path], capture_output=True)
188-
click.echo(str(verification_result.stdout) + " " + str(verification_result.stderr))
187+
verification_result = subprocess.run([script_path, image_path], capture_output=True, stderr=subprocess.STDOUT)
188+
click.echo(verification_result.stdout.decode())
189189
return verification_result.returncode == 0
190190

191191
@classmethod

tests/installer_bootloader_grub_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ def test_verify_image():
9393

9494
bootloader = grub.GrubBootloader()
9595
image = f'{grub.IMAGE_PREFIX}expeliarmus-{grub.IMAGE_PREFIX}abcde'
96-
assert bootloader.is_secure_upgrade_image_verification_supported()
96+
assert not bootloader.is_secure_upgrade_image_verification_supported()
9797
# command should fail
9898
assert not bootloader.verify_image_sign(image)

0 commit comments

Comments
 (0)