def handle(self, *args, **options): if len(args) != 1: raise CommandError("Please provide a subnet ID.") subnet = common.get_subnet(args[0]) pprint.pprint_subnet_in_db(subnet, stdout=self.stdout) self.stdout.write("\n\n") pprint.pprint_ippool(subnet, stdout=self.stdout)
def handle(self, *args, **options): if len(args) != 1: raise CommandError("Command accepts only the subnet ID as an" " argument. Use snf-manage subnet-modify --help" " for more info.") subnet_id = args[0] name = options["name"] if not name: raise CommandError("--name is mandatory") subnet = common.get_subnet(subnet_id) user_id = common.get_network(subnet.network.id).userid subnets.update_subnet(sub_id=subnet_id, name=name, user_id=user_id)