Commit 396db0ec authored by Sigmund Augdal's avatar Sigmund Augdal

Added support for adding a new mac to a security group to cli util

parent 2735cb1c
......@@ -25,6 +25,8 @@ def parse_args():
help="List groups for given mac")
parser.add_argument('--remove-from-group', default=None, metavar=("MAC", "GROUP"), nargs=2,
help="remove mac from group")
parser.add_argument('--add-to-group', default=None, metavar=("MAC", "GROUP"), nargs=2,
help="add mac to group")
parser.add_argument('--change-cloud', default=None, metavar=("GROUP", "CLOUD"), nargs=2,
help="move group to new cloud")
parser.add_argument('--rename-group', default=None, metavar=("GROUP", "NAME"), nargs=2,
......@@ -72,6 +74,10 @@ def main():
mac, group = args.remove_from_group
security_groups.delete_mac_from_group(etcd_client, group, mac)
print("Removed {} from {}".format(mac, group))
if args.add_to_group is not None:
mac, group = args.add_to_group
security_groups.add_mac_to_group(etcd_client, group, mac)
print("Added {} to {}".format(mac, group))
if args.change_cloud is not None:
group, cloud = args.change_cloud
security_groups.set_group_cloud(etcd_client, group, cloud, library=args.library)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment