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

Method delete_file

st2common/st2common/runners/paramiko_ssh.py:331–347  ·  view source on GitHub ↗

Delete a file on remote box. :param path: Path to remote file to be deleted. :type path: ``str`` :return: True if the file has been successfully deleted, False otherwise. :rtype: ``bool``

(self, path)

Source from the content-addressed store, hash-verified

329 return self.sftp.mkdir(dir_path)
330
331 def delete_file(self, path):
332 """
333 Delete a file on remote box.
334
335 :param path: Path to remote file to be deleted.
336 :type path: ``str``
337
338 :return: True if the file has been successfully deleted, False
339 otherwise.
340 :rtype: ``bool``
341 """
342
343 path = quote_unix(path)
344 extra = {"_path": path}
345 self.logger.debug("Deleting file", extra=extra)
346 self.sftp.unlink(path)
347 return True
348
349 def delete_dir(self, path, force=False, timeout=None):
350 """

Callers 1

test_delete_scriptMethod · 0.45

Calls 1

quote_unixFunction · 0.90

Tested by 1

test_delete_scriptMethod · 0.36