Skip to content

Commit

Permalink
Do not restrict MDRaidArrayDevice's memberDevices to type int
Browse files Browse the repository at this point in the history
We may also get long from various places (e.g. libblockdev via GObject
introspection).

Also improve the confusing error message.
  • Loading branch information
vpodzime committed Feb 27, 2015
1 parent 69d82a0 commit 1087076
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions blivet/devices/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

import os
import six

from gi.repository import BlockDev as blockdev
from gi.repository import GLib
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 1087076

Please sign in to comment.