本文整理汇总了Python中ClusterShell.Worker.Pdsh.WorkerPdsh.iter_node_errors方法的典型用法代码示例。如果您正苦于以下问题:Python WorkerPdsh.iter_node_errors方法的具体用法?Python WorkerPdsh.iter_node_errors怎么用?Python WorkerPdsh.iter_node_errors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClusterShell.Worker.Pdsh.WorkerPdsh
的用法示例。
在下文中一共展示了WorkerPdsh.iter_node_errors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testWorkerPdshNodeErrors
# 需要导入模块: from ClusterShell.Worker.Pdsh import WorkerPdsh [as 别名]
# 或者: from ClusterShell.Worker.Pdsh.WorkerPdsh import iter_node_errors [as 别名]
def testWorkerPdshNodeErrors(self):
# test iter_node_errors on distant pdsh workers
worker = WorkerPdsh(HOSTNAME, command="/usr/bin/printf 'foo\nbar\nxxx\n' 1>&2",
handler=None, timeout=None, stderr=True)
self._task.schedule(worker)
self._task.resume()
cnt = 1
for node, buf in worker.iter_node_errors():
cnt -= 1
if buf == b"foo\nbar\nxxx\n":
self.assertEqual(node, HOSTNAME)
self.assertEqual(cnt, 0)
示例2: testWorkerPdshNodeErrors
# 需要导入模块: from ClusterShell.Worker.Pdsh import WorkerPdsh [as 别名]
# 或者: from ClusterShell.Worker.Pdsh.WorkerPdsh import iter_node_errors [as 别名]
def testWorkerPdshNodeErrors(self):
"""test iter_node_errors on distant pdsh workers"""
task = task_self()
self.assert_(task != None)
worker = WorkerPdsh("localhost", command="/usr/bin/printf 'foo\nbar\nxxx\n' 1>&2",
handler=None, timeout=None, stderr=True)
task.schedule(worker)
task.resume()
cnt = 1
for node, buf in worker.iter_node_errors():
cnt -= 1
if buf == "foo\nbar\nxxx\n":
self.assertEqual(node, "localhost")
self.assertEqual(cnt, 0)