当前位置: 首页>>代码示例>>Python>>正文


Python WorkerPdsh.node_error_buffer方法代码示例

本文整理汇总了Python中ClusterShell.Worker.Pdsh.WorkerPdsh.node_error_buffer方法的典型用法代码示例。如果您正苦于以下问题:Python WorkerPdsh.node_error_buffer方法的具体用法?Python WorkerPdsh.node_error_buffer怎么用?Python WorkerPdsh.node_error_buffer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ClusterShell.Worker.Pdsh.WorkerPdsh的用法示例。


在下文中一共展示了WorkerPdsh.node_error_buffer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testExplicitPdshWorkerStdErr

# 需要导入模块: from ClusterShell.Worker.Pdsh import WorkerPdsh [as 别名]
# 或者: from ClusterShell.Worker.Pdsh.WorkerPdsh import node_error_buffer [as 别名]
    def testExplicitPdshWorkerStdErr(self):
        # test simple localhost command with explicit pdsh worker (stderr)
        worker = WorkerPdsh(HOSTNAME, command="echo alright 1>&2",
                            handler=None, stderr=True)
        self._task.schedule(worker)
        # run task
        self._task.resume()
        # test output
        self.assertEqual(worker.node_error_buffer(HOSTNAME), b"alright")

        # Re-test with stderr=False
        worker = WorkerPdsh(HOSTNAME, command="echo alright 1>&2",
                            handler=None, stderr=False)
        self._task.schedule(worker)
        # run task
        self._task.resume()
        # test output
        self.assertEqual(worker.node_error_buffer(HOSTNAME), None)
开发者ID:cea-hpc,项目名称:clustershell,代码行数:20,代码来源:TaskDistantPdshMixin.py

示例2: testExplicitPdshWorkerStdErr

# 需要导入模块: from ClusterShell.Worker.Pdsh import WorkerPdsh [as 别名]
# 或者: from ClusterShell.Worker.Pdsh.WorkerPdsh import node_error_buffer [as 别名]
    def testExplicitPdshWorkerStdErr(self):
        """test simple localhost command with explicit pdsh worker (stderr)"""
        # init worker
        worker = WorkerPdsh("localhost", command="echo alright 1>&2",
                    handler=None, stderr=True, timeout=5)
        self.assert_(worker != None)
        self._task.schedule(worker)
        # run task
        self._task.resume()
        # test output
        self.assertEqual(worker.node_error_buffer("localhost"), "alright")

        # Re-test with stderr=False
        worker = WorkerPdsh("localhost", command="echo alright 1>&2",
                    handler=None, stderr=False, timeout=5)
        self.assert_(worker != None)
        self._task.schedule(worker)
        # run task
        self._task.resume()
        # test output
        self.assertEqual(worker.node_error_buffer("localhost"), None)
开发者ID:ChristianKniep,项目名称:clustershell,代码行数:23,代码来源:TaskDistantPdshTest.py


注:本文中的ClusterShell.Worker.Pdsh.WorkerPdsh.node_error_buffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。