+ remove(tarball)
+
+
+def delete_framework_dir(node):
+ """Delete framework directory in /tmp/ on given node.
+
+ :param node: Node to delete framework directory on.
+ :type node: dict
+ """
+ host = node['host']
+ logger.console(
+ 'Deleting framework directory on {0} starts.'.format(host))
+ exec_cmd_no_error(
+ node, 'sudo rm -rf {0}'.format(con.REMOTE_FW_DIR),
+ message="Framework delete failed at node {host}".format(host=host),
+ timeout=100, include_reason=True)
+ logger.console(
+ 'Deleting framework directory on {0} done.'.format(host))
+
+
+def cleanup_node(node, results=None):
+ """Delete a tarball from a node.
+
+ :param node: A node where the tarball will be delete.
+ :param results: A list where to store the result of node cleanup, optional.
+ :type node: dict
+ :type results: list
+ :returns: True - success, False - error
+ :rtype: bool
+ """
+ host = node['host']
+ try:
+ delete_framework_dir(node)
+ except RuntimeError:
+ logger.error("Cleanup of node {0} failed.".format(host))
+ result = False
+ else:
+ logger.console('Cleanup of node {0} done.'.format(host))
+ result = True
+
+ if isinstance(results, list):
+ results.append(result)
+ return result