Coverage for drivers/mpath_cli : 29%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#!/usr/bin/python # # Copyright (C) Citrix Systems Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation; version 2.1 only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # # Talk to the multipathd cli
return
print "","MPath CLI failed"
util.SMlog("mpath cmd: %s" % cmd) (rc,stdout,stderr) = util.doexec(mpathcmd,cmd) if stdout != "multipathd> ok\nmultipathd> " \ and stdout != "multipathd> "+cmd+"\nok\nmultipathd> ": raise MPathCLIFail
mpexec("add path %s" % path)
mpexec("remove path %s" % path)
mpexec("remove map %s" % m)
mpexec("resize map %s" % m)
mpexec("reconfigure")
cmd="help" try: (rc,stdout,stderr) = util.doexec(mpathcmd,cmd) m=regex3.search(stdout) if m: return True else: return False except: return False
util.SMlog("mpath cmd: %s" % cmd) (rc,stdout,stderr) = util.doexec(mpathcmd,cmd) util.SMlog("mpath output: %s" % stdout) lines = stdout.split('\n')[:-1] if len(lines): m=regex2.search(lines[0]) lines[0]=str(m.group(2)) return lines
cmd="show map %s topology" % scsi_id return do_get_topology(cmd)
cmd="show topology" return do_get_topology(cmd)
lines = get_topology(scsi_id) matches = [] for line in lines: m=regex.search(line) if(m): matches.append(m.group(1)) return matches
cmd="list maps" util.SMlog("mpath cmd: %s" % cmd) (rc,stdout,stderr) = util.doexec(mpathcmd,cmd) util.SMlog("mpath output: %s" % stdout) return map(lambda x: x.split(' ')[0], stdout.split('\n')[1:-1])
while True: paths=list_paths(scsi_id) util.SMlog("list_paths succeeded") if len(paths)==0: return time.sleep(1)
|