]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
create a configuration removal function in nuke.py
authorAlfredo Deza <alfredo.deza@inktank.com>
Wed, 5 Nov 2014 14:37:59 +0000 (09:37 -0500)
committerAlfredo Deza <alfredo.deza@inktank.com>
Wed, 5 Nov 2014 14:37:59 +0000 (09:37 -0500)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
teuthology/nuke.py

index 2b14a0d9c7ba0cbe50256151e417c1d601ff15b3..8fb9485617618a9cc00e78997815f445fda14822 100644 (file)
@@ -90,6 +90,7 @@ def kill_hadoop(ctx):
                 log.info("Killing PID {0} ({1})".format(pid, cmdline))
                 remote.run(args=["kill", "-9", pid], check_status=False)
 
+
 def find_kernel_mounts(ctx):
     nodes = {}
     log.info('Looking for kernel mounts to handle...')
@@ -283,6 +284,32 @@ def remove_testing_tree(ctx):
         proc.wait()
 
 
+def remove_configuration_files(remotes):
+    """
+    Goes through a list of commonly used configuration files used for testing
+    that should not be left behind.
+
+    For example, sometimes ceph-deploy may be configured via
+    ``~/.cephdeploy.conf`` to alter how it handles installation by specifying
+    a default section in its config with custom locations.
+    """
+
+    nodes = {}
+
+    for remote in remotes:
+        proc = remote.run(
+            args=[
+                'rm', '-f', '/home/ubuntu/.cephdeploy.conf'
+            ],
+            wait=False,
+        )
+        nodes[remote.name] = proc
+
+    for name, proc in nodes.iteritems():
+        log.info('removing temporary configuration files on %s', name)
+        proc.wait()
+
+
 def synch_clocks(remotes):
     nodes = {}
     for remote in remotes: