本文整理汇总了Python中ClusterShell.Worker.Worker.DistantWorker._on_node_rc方法的典型用法代码示例。如果您正苦于以下问题:Python DistantWorker._on_node_rc方法的具体用法?Python DistantWorker._on_node_rc怎么用?Python DistantWorker._on_node_rc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClusterShell.Worker.Worker.DistantWorker
的用法示例。
在下文中一共展示了DistantWorker._on_node_rc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _on_remote_node_rc
# 需要导入模块: from ClusterShell.Worker.Worker import DistantWorker [as 别名]
# 或者: from ClusterShell.Worker.Worker.DistantWorker import _on_node_rc [as 别名]
def _on_remote_node_rc(self, node, rc, gateway):
"""remote rc received"""
DistantWorker._on_node_rc(self, node, rc)
self.logger.debug("_on_remote_node_rc %s %s via gw %s", node,
self._close_count, gateway)
# finalize rcopy: extract tar data
if self.source and self.reverse:
for node, buf in self._rcopy_bufs.iteritems():
tarfileobj = self._rcopy_tars[node]
if len(buf) > 0:
self.logger.debug("flushing node %s buf %d bytes", node,
len(buf))
tarfileobj.write(buf)
tarfileobj.flush()
tarfileobj.seek(0)
try:
tmptar = tarfile.open(fileobj=tarfileobj)
try:
self.logger.debug("%s extracting %d members in dest %s",
node, len(tmptar.getmembers()),
self.dest)
tmptar.extractall(path=self.dest)
except IOError, ex:
self._on_remote_node_msgline(node, ex, 'stderr',
gateway)
# note: try-except-finally not supported before python 2.5
finally:
tmptar.close()
self._rcopy_bufs = {}
self._rcopy_tars = {}
self.gwtargets[gateway].remove(node)
self._close_count += 1
self._check_fini(gateway)
示例2: _on_remote_node_rc
# 需要导入模块: from ClusterShell.Worker.Worker import DistantWorker [as 别名]
# 或者: from ClusterShell.Worker.Worker.DistantWorker import _on_node_rc [as 别名]
def _on_remote_node_rc(self, node, rc, gateway):
DistantWorker._on_node_rc(self, node, rc)
self.logger.debug("_on_remote_node_rc %s %s via gw %s", node,
self._close_count, gateway)
self.gwtargets[gateway].remove(node)
self._close_count += 1
self._check_fini(gateway)
示例3: _on_node_rc
# 需要导入模块: from ClusterShell.Worker.Worker import DistantWorker [as 别名]
# 或者: from ClusterShell.Worker.Worker.DistantWorker import _on_node_rc [as 别名]
def _on_node_rc(self, node, rc):
"""
Return code received from a node, update last* stuffs.
"""
DistantWorker._on_node_rc(self, node, rc)
self.closed_nodes.add(node)
示例4: _on_node_rc
# 需要导入模块: from ClusterShell.Worker.Worker import DistantWorker [as 别名]
# 或者: from ClusterShell.Worker.Worker.DistantWorker import _on_node_rc [as 别名]
def _on_node_rc(self, node, rc):
DistantWorker._on_node_rc(self, node, rc)
self.logger.debug("_on_node_rc %s %s (%s)", node, rc, self._close_count)
self._close_count += 1
示例5: _on_node_rc
# 需要导入模块: from ClusterShell.Worker.Worker import DistantWorker [as 别名]
# 或者: from ClusterShell.Worker.Worker.DistantWorker import _on_node_rc [as 别名]
def _on_node_rc(self, node, rc):
DistantWorker._on_node_rc(self, node, rc)
self._close_count += 1