Skip to content
Snippets Groups Projects
Commit ca11c8b6 authored by Jonah Husson's avatar Jonah Husson
Browse files

Merge branch 'hotfix/remove-truncate' of...

Merge branch 'hotfix/remove-truncate' of git.xx.network:xx_network/scheduling-scripts into hotfix/remove-truncate
parents 68090c94 08707e18
No related branches found
No related tags found
1 merge request!9Remove truncate and add on conflict clause instead
......@@ -229,9 +229,9 @@ def revoke_auth(to_revoke):
:param to_revoke: list of node IP addresses
"""
log.info(f"Revoking access to {len(to_revoke)} nodes...")
for nid in to_revoke:
cmd = f"sudo nft -a list chain inet filter input | grep '{nid}' | awk -F'handle ' '{{print $2}}' | xargs -Ixxx sudo nft delete rule inet filter input handle xxx"
log.debug(cmd)
for node_ip in to_revoke:
cmd = f"sudo nft -a list chain inet filter input | grep '{node_ip}' | awk -F'handle ' '{{print $2}}' | xargs -Ixxx sudo nft delete rule inet filter input handle xxx"
log.info(f"Running revoke command: {cmd}")
p = subprocess.Popen(cmd.split())
output, error = p.communicate()
if output:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment