def modify_vrf(arg, opts, shell_opts):
res = VRF.list({ '<STR_LIT>': arg })<EOL>if len(res) < <NUM_LIT:1>:<EOL><INDENT>print("<STR_LIT>" % arg, file=sys.stderr)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>v = res[<NUM_LIT:0>]<EOL>if '<STR_LIT>' in opts:<EOL><INDENT>v.rt = opts['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT:name>' in opts:<EOL><INDENT>v.name = opts['<STR_LIT:name>']<EOL><DEDENT>if '<STR_LIT:description>' in opts:<EOL><INDENT>v.description = opts['<STR_LIT:description>']<EOL><DEDENT>if '<STR_LIT>' in opts:<EOL><INDENT>tags = list(csv.reader([opts.get('<STR_LIT>', '<STR_LIT>')], escapechar='<STR_LIT:\\>'))[<NUM_LIT:0>]<EOL>v.tags = {}<EOL>for tag_name in tags:<EOL><INDENT>tag = Tag()<EOL>tag.name = tag_name<EOL>v.tags[tag_name] = tag<EOL><DEDENT><DEDENT>for avp in opts.get('<STR_LIT>', []):<EOL><INDENT>try:<EOL><INDENT>key, value = avp.split('<STR_LIT:=>', <NUM_LIT:1>)<EOL><DEDENT>except ValueError:<EOL><INDENT>print("<STR_LIT>" % avp, file=sys.stderr)<EOL>return<EOL><DEDENT>v.avps[key] = value<EOL><DEDENT>v.save()<EOL>print("<STR_LIT>" % vrf_format(v))<EOL>
Modify a VRF with the options set in opts