elif isinstance(z, NscZoneSecondary):
status = f'from {z.primary_server}'
elif isinstance(z, NscZoneAlias):
- status = f'to {z.alias_for.name}'
+ status = f'for "{z.alias_for.name}"'
else:
raise NotImplementedError()
+ name = z.name
+ if len(name) > 30 and not args.long:
+ name = name[:16] + '[...]' + name[-16:]
if do_show:
- table.add_row([action, z.name, z.zone_type.name, status])
+ table.add_row([action, name, z.zone_type.name, status])
print(table.draw())
status_parser = subparsers.add_parser('status', help='list status of zones', description='List status of zones')
status_parser.add_argument('-a', '--all', default=False, action='store_true', help='show non-primary zones')
+ status_parser.add_argument('-l', '--long', default=False, action='store_true', help='do not abbreviate zone names')
update_parser = subparsers.add_parser('update', help='update configuration', description='Update zone files and daemon configuration as needed')