uuids[getUUID(n)] = 1
init_names(n)
+def get_format_flag(options):
+ if options.has_key('format'):
+ if options['format']:
+ return 'yes'
+ return 'no'
+
class GenConfig:
doc = None
dom = None
def name2uuid(lustre, name, tag="", fatal=1):
ret = findByName(lustre, name, tag)
- if not ret and fatal:
- error('name2uuid:', name, "not found.")
+ if not ret:
+ if fatal:
+ error('name2uuid:', name, "not found.")
+ else:
+ return ""
return getUUID(ret)
# XXX: assumes only one network element per node. will fix this
if not net_uuid:
error("NODE: ", node_name, "not found")
- obd = gen.obd(obdname, obd_uuid, "extN", devname, "no", size)
+ obd = gen.obd(obdname, obd_uuid, "extN", devname, get_format_flag(options), size)
ost = gen.ost(ostname, ost_uuid, obd_uuid, net_uuid)
osc = gen.osc(oscname, osc_uuid, obd_uuid, ost_uuid)
if ret:
error("MOUNTPOINT: ", name, " already exists.")
- lov_uuid = name2uuid(lustre, lov_name)
mdc_uuid = name2uuid(lustre, mdc_name)
+ lov_uuid = name2uuid(lustre, lov_name, tag='lov', fatal=0)
+ if not lov_uuid:
+ lov_uuid = name2uuid(lustre, lov_name, tag='osc', fatal=1)
uuid = get_uuid(name)
mtpt = gen.mountpoint(name, uuid, mdc_uuid, lov_uuid, path)
error("NODE: ", node_name, "not found")
- mds = gen.mds(mds_name, mds_uuid, "extN", devname, "no", net_uuid, node_uuid, dev_size=size)
+ mds = gen.mds(mds_name, mds_uuid, "extN", devname, get_format_flag(options),
+ net_uuid, node_uuid, dev_size=size)
mdc = gen.mdc(mdc_name, mdc_uuid, mds_uuid)
lustre.appendChild(mds)
lustre.appendChild(mdc)