From: rread Date: Wed, 30 Oct 2002 21:03:43 +0000 (+0000) Subject: * change device_list to use the command line interface instead of stdin X-Git-Tag: 0.5.16~66 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=309d129bdae043d1c6449ec46d094bbf39a89c1b;p=fs%2Flustre-release.git * change device_list to use the command line interface instead of stdin --- diff --git a/lustre/utils/lconf b/lustre/utils/lconf index a89bc27..b1822a1 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -281,6 +281,16 @@ class LCTLInterface: raise CommandError(self.lctl, err, rc) return rc, out + def runcmd(self, *args): + """ + run lctl using the command line + """ + cmd = string.join(map(str,args)) + rc, out = run(self.lctl, cmd) + if rc: + raise CommandError(self.lctl, out, rc) + return rc, out + def network(self, net, nid): """ initialized network and add "self" """ @@ -412,10 +422,7 @@ class LCTLInterface: # get list of devices def device_list(self): - cmds = """ - device_list - quit""" - rc, out = self.run(cmds) + rc, out = self.runcmd('device_list') return out # ============================================================ @@ -509,7 +516,8 @@ def mkfs(fstype, dev): (ret, out) = run (mkfs, force, dev) if ret: panic("Unable to build fs:", dev) - # enable hash tree indexing on fs + # enable hash tree indexing on fsswe + # FIXME: this check can probably go away on 2.5 if fstype == 'extN': htree = 'echo "feature FEATURE_C5" | debugfs -w' (ret, out) = run (htree, dev) @@ -939,6 +947,7 @@ class MDS(Module): Module.__init__(self, 'MDS', dom_node) self.devname, self.size = get_device(dom_node) self.fstype = get_text(dom_node, 'fstype') + # FIXME: if fstype not set, then determine based on kernel version self.format = get_text(dom_node, 'autoformat', "no") if self.fstype == 'extN': self.add_module('lustre/extN', 'extN') @@ -995,6 +1004,7 @@ class OBD(Module): self.obdtype = get_attr(dom_node, 'type') self.devname, self.size = get_device(dom_node) self.fstype = get_text(dom_node, 'fstype') + # FIXME: if fstype not set, then determine based on kernel version self.format = get_text(dom_node, 'autoformat', 'yes') if self.fstype == 'extN': self.add_module('lustre/extN', 'extN')