MCPcopy Create free account
hub / github.com/StackStorm/st2 / _put_files

Method _put_files

st2common/st2common/runners/parallel_ssh.py:319–338  ·  view source on GitHub ↗
(
        self, local_path, remote_path, host, results, mode=None, mirror_local_mode=False
    )

Source from the content-addressed store, hash-verified

317 results[host] = self._generate_error_result(exc=ex, message=error)
318
319 def _put_files(
320 self, local_path, remote_path, host, results, mode=None, mirror_local_mode=False
321 ):
322 try:
323 LOG.debug("Copying file to host: %s" % host)
324 if os.path.isdir(local_path):
325 result = self._hosts_client[host].put_dir(local_path, remote_path)
326 else:
327 result = self._hosts_client[host].put(
328 local_path,
329 remote_path,
330 mirror_local_mode=mirror_local_mode,
331 mode=mode,
332 )
333 LOG.debug("Result of copy: %s" % result)
334 results[host] = result
335 except Exception as ex:
336 error = "Failed sending file(s) in path %s to host %s" % (local_path, host)
337 LOG.exception(error)
338 results[host] = self._generate_error_result(exc=ex, message=error)
339
340 def _mkdir(self, host, path, results):
341 try:

Callers

nothing calls this directly

Calls 3

put_dirMethod · 0.80
putMethod · 0.45

Tested by

no test coverage detected