diff options
| author | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-02-13 11:11:02 -0500 | 
|---|---|---|
| committer | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-02-13 11:11:02 -0500 | 
| commit | c9a5290224dd7254a23cb6e5e3baa43a21fd2362 (patch) | |
| tree | 226633ec6324179cf2448247f15d54300719a967 /tests | |
| parent | 9448a121130bfd7964b3d08e19799538ae189374 (diff) | |
tests/utils.py: added new function rm_nodedirs.
rm_nodedirs purges the node directories. This function will be used
later to remove the test node directories.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/utils.py | 13 | 
1 files changed, 12 insertions, 1 deletions
| diff --git a/tests/utils.py b/tests/utils.py index 8b974ed..f21bd38 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -22,7 +22,7 @@ from nose.tools import *  from os import path, remove, rmdir  from combox.config import config_cb, get_nodedirs -from combox.file import relative_path +from combox.file import relative_path, purge_dir  def get_input_func():      """Returns the input function @@ -57,6 +57,17 @@ def get_config():      return config_cb(config_dir, pass_func, input_func, write=False) +def rm_nodedirs(config): +    """Removes node directories""" +    nodes = get_nodedirs(config) +    for node in nodes: +        try: +            purge_dir(node) +            rmdir(node) +        except OSError, e: +            print "Problem deleting", node, e + +  def shardedp(f):      """Checks if file's shards exists in the node directories""" | 
