From 251d9e417a5b7e31e1036cca9501e32958df0b01 Mon Sep 17 00:00:00 2001 From: rread Date: Wed, 28 Aug 2002 02:36:56 +0000 Subject: [PATCH] * llrmount.sh now uses lconf * enabled lconf --reformat * disabled the feature until I figure out how to determine if a block device actually has an fs or not --- lustre/tests/llmount.sh | 2 +- lustre/tests/llrmount.sh | 11 +++++------ lustre/utils/lconf | 27 +++++++++++++++++++++------ 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/lustre/tests/llmount.sh b/lustre/tests/llmount.sh index 508208c..4f9c7aa 100755 --- a/lustre/tests/llmount.sh +++ b/lustre/tests/llmount.sh @@ -6,5 +6,5 @@ if [ ! -f local.xml ]; then ./local.sh fi -${LCONF} --gdb local.xml +${LCONF} --reformat --gdb local.xml diff --git a/lustre/tests/llrmount.sh b/lustre/tests/llrmount.sh index 4b8abc9..51a559e 100755 --- a/lustre/tests/llrmount.sh +++ b/lustre/tests/llrmount.sh @@ -1,10 +1,9 @@ #!/bin/sh -SRCDIR="`dirname $0`/" -. $SRCDIR/common.sh +LCONF=../utils/lconf -export DEBUG_WAIT=yes -. $SRCDIR/llrsetup.sh $SRCDIR/net-local.cfg $SRCDIR/client-mount.cfg $SRCDIR/mds.cfg $SRCDIR/obdfilter.cfg $SRCDIR/ldlm.cfg || exit 2 +if [ ! -f local.xml ]; then + ./local.sh +fi -debug_client_on -#debug_client_off +${LCONF} --gdb local.xml diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 0c8db8b..a652d89 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -149,7 +149,6 @@ def fixme(msg = "this feature"): def panic(*args): msg = string.join(map(str,args)) - print msg if not config.noexec(): raise LconfError(msg) @@ -193,7 +192,7 @@ class CommandError (exceptions.Exception): class LconfError (exceptions.Exception): def __init__(self, args): - self.args + self.args = args # ============================================================ @@ -473,13 +472,24 @@ def clean_loop(file): log('unable to clean loop device:', dev, 'for file:', file) logall(out) +# determine if dev is formatted as a filesystem +def need_format(fstype, dev): + # FIXME don't know how to implement this + return 0 + # initialize a block device if needed def block_dev(dev, size, fstype, format): if config.noexec(): return dev if not is_block(dev): dev = init_loop(dev, size, fstype) - if (format == 'yes'): + if config.reformat() or (need_format(fstype, dev) and format == 'yes'): mkfs(fstype, dev) + +# else: +# panic("device:", dev, +# "not prepared, and autoformat is not set.\n", +# "Rerun with --reformat option to format ALL filesystems") + return dev def get_local_address(net_type): @@ -531,7 +541,7 @@ class Module: self.info() try: lctl.cleanup(self.name, self.uuid) - except CommandError: + except CommandError, e: print "cleanup failed: ", self.name def add_module(self, modname): @@ -572,6 +582,8 @@ class Module: rev = self.kmodule_list rev.reverse() for mod in rev: + if not self.mod_loaded(mod): + continue log('unloading module:', mod) if config.noexec(): continue @@ -617,8 +629,11 @@ class Network(Module): self.info(self.net_type, self.nid, self.port) try: lctl.cleanup("RPCDEV", "") + except CommandError, e: + print "cleanup failed: ", self.name + try: lctl.disconnectAll(self.net_type) - except CommandError: + except CommandError, e: print "cleanup failed: ", self.name if self.net_type == 'tcp': # yikes, this ugly! need to save pid in /var/something @@ -779,7 +794,7 @@ class OSC(Module): try: lctl.disconnect(srv.net_type, srv.nid, srv.port, srv.uuid) except CommandError: - print "disconnect failed: ", self.name + print " failed: ", self.name try: lctl.cleanup(self.name, self.uuid) except CommandError: -- 1.8.3.1