def main():
    """Main method to configure a subinterface."""
    parser = argparse.ArgumentParser()
    parser.add_argument('vlan', help="VLAN number (1-4094)", type=int)
    parser.add_argument('prefix', help="IPv4 or IPv6 prefix")
    parser.add_argument('--template', '-t', default=TEMPLATE, help="Jinja2 template file name")
    parser.add_argument('--config', '-c', default=FILE, help="XML config file name")
    parser.add_argument('--interface', '-i', default=BASE, help="interface name to use")
    parser.add_argument('--id', '-d', default=INT_ID, help="interface ID to use")
    parser.add_argument('--user', '-u', default=USER, help="user name on remote host")
    parser.add_argument('--password', '-p', default=PASS, help="password on remote host")
    parser.add_argument('--port', '-P', default=PORT, help="port on remote host")
    parser.add_argument('--host', '-H', default=HOST, help="remote host")
    args = parser.parse_args()

    # check for valid VLAN ID
    if args.vlan < 1 or 4094 > args.vlan:
        parser.print_usage()
        print("invalid VLAN ID %s" % str(args.vlan))
        sys.exit()

    # check for valid prefix
    try:
        ip = netaddr.IPNetwork(args.prefix)
    except netaddr.core.AddrFormatError as e:
        parser.print_usage()
        print(e)
        sys.exit()

    return create_vlan(args.host, args.port, args.user, args.password, args.interface,
                       args.id, args.vlan, ip.ip, ip.netmask, args.template, args.config)
dataset/ETHPy150Open CiscoDevNet/netconf-examples/netconf-102/create_subinterface.py/main/swapped operands of `>`