return dev.firstChild.data, size
# Get the text content from the first matching child
+# If there is no content (or it is all whitespace), return
+# the default
def getText(node, tag, default=""):
list = node.getElementsByTagName(tag)
if len(list) > 0:
node = list[0]
node.normalize()
- return node.firstChild.data
- else:
- return default
+ if node.firstChild:
+ txt = string.strip(node.firstChild.data)
+ if txt:
+ return txt
+ return default
def get_ost_net(node, uuid):
ost = lookup(node, uuid)
if __name__ == "__main__":
try:
main()
- except LConfError, e:
+ except LconfError, e:
print e
except CommandError, e:
e.dump()
Nettype is either tcp, elan, or gm.
Requires a node argument
---lov lov_name [mdc_name stripe_sz stripe_off pattern]
- Creates a logical volume
- When used with other commands, it specifics the lov to modify
-
--mds device [size]
Create a MDS using the device
Requires --node
+--lov lov_name [mdc_name stripe_sz stripe_off pattern]
+ Creates a logical volume
+ When used with other commands, it specifics the lov to modify
+
--mdc mdc_name
Configures a MDC for a node.
Requires --node
Requires --node
If --lov lov_name is used, this device is added to lov.
---mtpt /mnt/point mdc_name lov_name|osc_name
+--mtpt /mnt/point mds_name lov_name|osc_name
Creates a client mount point.
Requires --node