本文整理匯總了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