Commit c032b2ce authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Make BlockDev subclasses adhere to new interface

In commit 702c3270

 two new parameters were added to the
constructor of BlockDev. Make the subclassess accept these
additional parameters as well.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 702c3270
......@@ -69,14 +69,14 @@ class LogicalVolume(base.BlockDev):
_INVALID_NAMES = compat.UniqueFrozenset([".", "..", "snapshot", "pvmove"])
_INVALID_SUBSTRINGS = compat.UniqueFrozenset(["_mlog", "_mimage"])
def __init__(self, unique_id, children, size, params, dyn_params):
def __init__(self, unique_id, children, size, params, dyn_params, *args):
"""Attaches to a LV device.
The unique_id is a tuple (vg_name, lv_name)
"""
super(LogicalVolume, self).__init__(unique_id, children, size, params,
dyn_params)
dyn_params, *args)
if not isinstance(unique_id, (tuple, list)) or len(unique_id) != 2:
raise ValueError("Invalid configuration data %s" % str(unique_id))
self._vg_name, self._lv_name = unique_id
......@@ -724,14 +724,14 @@ class PersistentBlockDevice(base.BlockDev):
For the time being, pathnames are required to lie under /dev.
"""
def __init__(self, unique_id, children, size, params, dyn_params):
def __init__(self, unique_id, children, size, params, dyn_params, *args):
"""Attaches to a static block device.
The unique_id is a path under /dev.
"""
super(PersistentBlockDevice, self).__init__(unique_id, children, size,
params, dyn_params)
params, dyn_params, *args)
if not isinstance(unique_id, (tuple, list)) or len(unique_id) != 2:
raise ValueError("Invalid configuration data %s" % str(unique_id))
self.dev_path = unique_id[1]
......@@ -837,12 +837,12 @@ class RADOSBlockDevice(base.BlockDev):
this to be functional.
"""
def __init__(self, unique_id, children, size, params, dyn_params):
def __init__(self, unique_id, children, size, params, dyn_params, *args):
"""Attaches to an rbd device.
"""
super(RADOSBlockDevice, self).__init__(unique_id, children, size, params,
dyn_params)
dyn_params, *args)
if not isinstance(unique_id, (tuple, list)) or len(unique_id) != 2:
raise ValueError("Invalid configuration data %s" % str(unique_id))
......
......@@ -174,7 +174,7 @@ class DRBD8Dev(base.BlockDev):
# timeout constants
_NET_RECONFIG_TIMEOUT = 60
def __init__(self, unique_id, children, size, params, dyn_params):
def __init__(self, unique_id, children, size, params, dyn_params, *args):
if children and children.count(None) > 0:
children = []
if len(children) not in (0, 2):
......@@ -199,7 +199,7 @@ class DRBD8Dev(base.BlockDev):
logging.info("drbd%s: Ignoring unreadable meta device", self._aminor)
children = []
super(DRBD8Dev, self).__init__(unique_id, children, size, params,
dyn_params)
dyn_params, *args)
self.major = self._DRBD_MAJOR
info = DRBD8.GetProcInfo()
......
......@@ -167,14 +167,14 @@ class FileStorage(base.BlockDev):
The unique_id for the file device is a (file_driver, file_path) tuple.
"""
def __init__(self, unique_id, children, size, params, dyn_params):
def __init__(self, unique_id, children, size, params, dyn_params, *args):
"""Initalizes a file device backend.
"""
if children:
raise errors.BlockDeviceError("Invalid setup for file device")
super(FileStorage, self).__init__(unique_id, children, size, params,
dyn_params)
dyn_params, *args)
if not isinstance(unique_id, (tuple, list)) or len(unique_id) != 2:
raise ValueError("Invalid configuration data %s" % str(unique_id))
self.driver = unique_id[0]
......
......@@ -284,7 +284,7 @@ class GlusterStorage(base.BlockDev):
The unique_id for the file device is a (file_driver, file_path) tuple.
"""
def __init__(self, unique_id, children, size, params, dyn_params):
def __init__(self, unique_id, children, size, params, dyn_params, *args):
"""Initalizes a file device backend.
"""
......@@ -307,7 +307,7 @@ class GlusterStorage(base.BlockDev):
self.file = None
super(GlusterStorage, self).__init__(unique_id, children, size,
params, dyn_params)
params, dyn_params, *args)
self.Attach()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment