From 24d0e417ef9d2927c5964b58f986b844898a506a Mon Sep 17 00:00:00 2001 From: rread Date: Mon, 26 Aug 2002 23:44:36 +0000 Subject: [PATCH] - more careful error checking --- lustre/utils/lconf | 12 ++++++++---- lustre/utils/lmc | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 65eaada..3b997f1 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -839,14 +839,18 @@ def getDevice(obd): 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) @@ -1146,7 +1150,7 @@ def main(): if __name__ == "__main__": try: main() - except LConfError, e: + except LconfError, e: print e except CommandError, e: e.dump() diff --git a/lustre/utils/lmc b/lustre/utils/lmc index 66f046a..b103a0e 100755 --- a/lustre/utils/lmc +++ b/lustre/utils/lmc @@ -59,14 +59,14 @@ Commands: 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 @@ -78,7 +78,7 @@ Commands: 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 -- 1.8.3.1