Skip to content

Commit

Permalink
plugin_disk: Fix checking the 'removable' attribute on python3
Browse files Browse the repository at this point in the history
The 'removable' attribute is a bytestring, so it will never be equal to
"0" in python3. Check equality with b"0" instead.

The patch was originally written by Tomáš Korbař.

Signed-off-by: Ondřej Lysoněk <[email protected]>
  • Loading branch information
olysonek committed Jan 24, 2019
1 parent 668bf74 commit 2cc3d74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tuned/plugins/plugin_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _get_device_objects(self, devices):
@classmethod
def _device_is_supported(cls, device):
return device.device_type == "disk" and \
device.attributes.get("removable", None) == "0" and \
device.attributes.get("removable", None) == b"0" and \
(device.parent is None or \
device.parent.subsystem in ["scsi", "virtio", "xen"])

Expand Down

0 comments on commit 2cc3d74

Please sign in to comment.