Created
August 7, 2015 14:46
Delete all static address allocations from a mass called maas.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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