Changeset 2513 for trunk/packages/invirt-remote/python/remote/monocast.py
- Timestamp:
- Oct 24, 2009, 8:40:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-remote/python/remote/monocast.py
r2495 r2513 5 5 hostnames = [ h.hostname for h in config.hosts ] 6 6 7 def monocast(args, host s = hostnames, randomize = True):7 def monocast(args, hostnames = hostnames, randomize = True): 8 8 """ 9 9 Given a command and a list of hostnames or IPs, issue the command to each … … 18 18 """ 19 19 if(randomize): 20 host s = random.sample(hosts, len(hosts))20 hostnames = random.sample(hostnames, len(hostnames)) 21 21 hostsdown = [] 22 for host in host s:22 for host in hostnames: 23 23 pipe = Popen(['remctl', host, 'remote', 'web'] + args, stdout=PIPE, stderr=PIPE) 24 24 output = pipe.communicate() … … 27 27 hostsdown.append(host) 28 28 else: 29 #raise RuntimeError("remctl to host %s returned non-zero exit status %d; stderr:\n%s"30 # % (host, pipe.returncode, output[1]))31 29 return (host, hostsdown, pipe.returncode,) + output 32 30 else:
Note: See TracChangeset
for help on using the changeset viewer.