"""
-# pylint: disable-msg=E0203,W0201
+# pylint: disable=E0203,W0201
# E0203: Access to member %r before its definition, since we use
# objects.py which doesn't explicitely initialise its members
raise errors.ConfigurationError("Invalid object passed to FromDict:"
" expected dict, got %s" % type(val))
val_str = dict([(str(k), v) for k, v in val.iteritems()])
- obj = cls(**val_str) # pylint: disable-msg=W0142
+ obj = cls(**val_str) # pylint: disable=W0142
return obj
@staticmethod
"""
if self.dev_type == constants.LD_LV:
return "/dev/%s/%s" % (self.logical_id[0], self.logical_id[1])
+ elif self.dev_type == constants.LD_BLOCKDEV:
+ return self.logical_id[1]
return None
def ChildrenNeeded(self):
devices needs to (or can) be assembled.
"""
- if self.dev_type in [constants.LD_LV, constants.LD_FILE]:
+ if self.dev_type in [constants.LD_LV, constants.LD_FILE,
+ constants.LD_BLOCKDEV]:
result = [node]
elif self.dev_type in constants.LDS_DRBD:
result = [self.logical_id[0], self.logical_id[1]]
"""
if self.dev_type == constants.LD_LV:
- val = "<LogicalVolume(/dev/%s/%s" % self.logical_id
+ val = "<LogicalVolume(/dev/%s/%s" % self.logical_id
elif self.dev_type in constants.LDS_DRBD:
node_a, node_b, port, minor_a, minor_b = self.logical_id[:5]
val = "<DRBD8("
node = self.primary_node
if lvmap is None:
- lvmap = { node : [] }
+ lvmap = {
+ node: [],
+ }
ret = lvmap
else:
if not node in lvmap:
for dev in devs:
if dev.dev_type == constants.LD_LV:
- lvmap[node].append(dev.logical_id[0]+"/"+dev.logical_id[1])
+ lvmap[node].append(dev.logical_id[0] + "/" + dev.logical_id[1])
elif dev.dev_type in constants.LDS_DRBD:
if dev.children:
"""Fill defaults for missing configuration values.
"""
- # pylint: disable-msg=E0203
+ # pylint: disable=E0203
# because these are "defined" via slots, not manually
if self.master_capable is None:
self.master_capable = True
self.powered = True
-class NodeGroup(ConfigObject):
+class NodeGroup(TaggableObject):
"""Config object representing a node group."""
__slots__ = [
"name",
self.mtime = time.time()
def FillND(self, node):
- """Return filled out ndparams for L{object.Node}
+ """Return filled out ndparams for L{objects.Node}
@type node: L{objects.Node}
@param node: A Node object to fill
"""Fill defaults for missing configuration values.
"""
- # pylint: disable-msg=E0203
+ # pylint: disable=E0203
# because these are "defined" via slots, not manually
if self.hvparams is None:
self.hvparams = constants.HVC_DEFAULTS
if self.prealloc_wipe_disks is None:
self.prealloc_wipe_disks = False
+ # shared_file_storage_dir added before 2.5
+ if self.shared_file_storage_dir is None:
+ self.shared_file_storage_dir = ""
+
def ToDict(self):
"""Custom function for cluster.
return FillDict(result, os_params)
def FillND(self, node, nodegroup):
- """Return filled out ndparams for L{objects.NodeGroup} and L{object.Node}
+ """Return filled out ndparams for L{objects.NodeGroup} and L{objects.Node}
@type node: L{objects.Node}
@param node: A Node object to fill