+ 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
+ """
+ logger.console('Deleting framework directory on {0}'
+ .format(node['host']))
+ ssh = SSH()
+ ssh.connect(node)
+ (ret_code, _, _) = ssh.exec_command(
+ 'sudo rm -rf {0}'
+ .format(con.REMOTE_FW_DIR), timeout=100)
+ if ret_code != 0:
+ raise RuntimeError('Deleting framework directory on {0} failed'
+ .format(node))
+
+
+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
+ """
+ try:
+ delete_framework_dir(node)
+ except RuntimeError:
+ logger.error("Cleanup of node {0} failed".format(node['host']))
+ result = False
+ else:
+ logger.console('Cleanup of node {0} done'.format(node['host']))
+ result = True
+
+ if isinstance(results, list):
+ results.append(result)
+ return result