plugin_disk: Fix checking the 'removable' attribute on python3
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 <olysonek@redhat.com>
This commit is contained in:
parent
668bf7448d
commit
2cc3d74798
1 changed files with 1 additions and 1 deletions
|
|
@ -39,7 +39,7 @@ class DiskPlugin(hotplug.Plugin):
|
|||
@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"])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue