def add_vrf(arg, opts, shell_opts):
    """ Add VRF to NIPAP
    """

    v = VRF()
    v.rt = opts.get('rt')
    v.name = opts.get('name')
    v.description = opts.get('description')
    v.tags = list(csv.reader([opts.get('tags', '')], escapechar='\\'))[0]

    for avp in opts.get('extra-attribute', []):
        try:
            key, value = avp.split('=', 1)
        except __HOLE__:
            print >> sys.stderr, "ERROR: Incorrect extra-attribute: %s. Accepted form: 'key=value'\n" % avp
            return
        v.avps[key] = value

    try:
        v.save()
    except pynipap.NipapError as exc:
        print >> sys.stderr, "Could not add VRF to NIPAP: %s" % str(exc)
        sys.exit(1)

    print "Added %s" % (vrf_format(v))
dataset/ETHPy150Open SpriteLink/NIPAP/nipap-cli/nipap_cli/nipap_cli.py/add_vrf