From: John Spray Date: Wed, 20 Aug 2014 11:09:29 +0000 (+0100) Subject: nuke: clear test firewall rules X-Git-Tag: 1.1.0~1194^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c57b4c49418987b4df0930f2db8e6421bbaa70d;p=teuthology.git nuke: clear test firewall rules Signed-off-by: John Spray --- diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 6f4513484..df549412e 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -24,6 +24,19 @@ from .task.internal import connect log = logging.getLogger(__name__) +def clear_firewall(ctx): + """ + Remove any iptables rules created by teuthology. These rules are identified by containing + a comment with 'teuthology' in it. Non-teuthology firewall rules are unaffected. + """ + ctx.cluster.run( + args=[ + "sudo", "sh", "-c", "iptables-save | grep -v teuthology | iptables-restore" + ], + wait=False, + ) + + def shutdown_daemons(ctx): nodes = {} for remote in ctx.cluster.remotes.iterkeys(): @@ -420,6 +433,10 @@ def nuke_helper(ctx, should_unlock): check_lock(ctx, None) connect(ctx, None) + log.info("Clearing teuthology firewall rules...") + clear_firewall(ctx) + log.info("Cleared teuthology firewall rules.") + log.info('Unmount ceph-fuse and killing daemons...') shutdown_daemons(ctx) log.info('All daemons killed.')