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():
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.')