From: Vratislav Podzimek <vpodzime(a)redhat.com>
We may also get long from various places (e.g. libblockdev via GObject
introspection).
Also improve the confusing error message.
---
blivet/devices/md.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/blivet/devices/md.py b/blivet/devices/md.py
index 5c92c09..0e8813e 100644
--- a/blivet/devices/md.py
+++ b/blivet/devices/md.py
@@ -20,6 +20,7 @@
#
import os
+import six
from gi.repository import BlockDev as blockdev
from gi.repository import GLib
@@ -267,8 +268,8 @@ def _getMemberDevices(self):
return self._memberDevices
def _setMemberDevices(self, number):
- if not isinstance(number, int):
- raise ValueError("memberDevices is an integer")
+ if not isinstance(number, six.integer_types):
+ raise ValueError("memberDevices must be an integer")
if not self.exists and number > self.totalDevices:
raise ValueError("memberDevices cannot be greater than
totalDevices")
--
To view this commit on github, visit
https://github.com/rhinstaller/blivet/commit/108707667b24235a0eb7d7ae9f94...