On Fri, 2013-12-13 at 09:58 -0600, David Lehman wrote:
diff --git a/blivet/formats/disklabel.py
b/blivet/formats/disklabel.py
index bfb707a..323b36b 100644
--- a/blivet/formats/disklabel.py
+++ b/blivet/formats/disklabel.py
@@ -45,18 +45,20 @@ class DiskLabel(DeviceFormat):
_supported = False # is supported
def __init__(self, *args, **kwargs):
- """ Create a DiskLabel instance.
-
- Keyword Arguments:
-
- labelType -- type of disklabel to create
- device -- path to the underlying device
- exists -- indicates whether this is an existing format
-
+ """
+ :keyword device: full path to the block device node (required)
+ :type device: str
+ :keyword labelType: type of disklabel to create
+ :type labelType: str
+ :keyword exists: whether the formatting exists
+ :type exists: bool
"""
log_method_call(self, *args, **kwargs)
DeviceFormat.__init__(self, *args, **kwargs)
+ if not self.device:
+ raise ValueError("DiskLabel requires a valid device path")
+
I am dropping the above and the associated piece of the docstring. All
other formats can be instantiated without any arguments and that's
useful.