Skip to content

Instantly share code, notes, and snippets.

@dooferlad
Created August 7, 2015 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dooferlad/082996faeb2168a76ab4 to your computer and use it in GitHub Desktop.
Save dooferlad/082996faeb2168a76ab4 to your computer and use it in GitHub Desktop.
Delete all static address allocations from a mass called maas.
#!/usr/bin/python
import subprocess
import json
addresses = json.loads(subprocess.check_output("maas maas ipaddresses read", shell=True))
for addr in addresses:
subprocess.check_call("maas maas ipaddresses release ip=" + addr['ip'], shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment