本文整理匯總了Python中glusto.core.Glusto.run_parallel方法的典型用法代碼示例。如果您正苦於以下問題:Python Glusto.run_parallel方法的具體用法?Python Glusto.run_parallel怎麽用?Python Glusto.run_parallel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類glusto.core.Glusto
的用法示例。
在下文中一共展示了Glusto.run_parallel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_run_parallel
# 需要導入模塊: from glusto.core import Glusto [as 別名]
# 或者: from glusto.core.Glusto import run_parallel [as 別名]
def test_run_parallel(self):
"""Testing SSH run_parallel() method"""
print "Running: %s - %s" % (self.id(), self.shortDescription())
results = g.run_parallel(self.hosts, 'echo -n %s' % self.test_string)
hosts_already_tested = []
for host, result in results.iteritems():
# test host is in list of hosts to test
self.assertIn(host, self.hosts)
# test host has not already been tested
self.assertNotIn(host, hosts_already_tested)
hosts_already_tested.append(host)
print host
rcode, rout, rerr = result
self.assertEqual(rcode, 0)
self.assertEqual(rout, self.test_string)
print rout
self.assertEqual(rerr, '')