Skip to content

Commit 1cb19cc

Browse files
authored
testinfra/modules/blockdevice: Don't fail on stderr (#745)
The `blockdevice` module raises a `RuntimeError` if `blockdev` returns with a non-zero exit code, or if stderr is not empty. But the latter can happen even when there's no failure at all, for instance if `sshd` has a banner message configured (which gets output to stderr whenever someone connects to the host). Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
1 parent 01db77f commit 1cb19cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testinfra/modules/blockdevice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def _data(self):
130130
header = ["RO", "RA", "SSZ", "BSZ", "StartSec", "Size", "Device"]
131131
command = "blockdev --report %s"
132132
blockdev = self.run(command, self.device)
133-
if blockdev.rc != 0 or blockdev.stderr:
133+
if blockdev.rc != 0:
134134
raise RuntimeError("Failed to gather data: {}".format(blockdev.stderr))
135135
output = blockdev.stdout.splitlines()
136136
if len(output) < 2:

0 commit comments

Comments
 (0)