@fiss_cmd<EOL>def config_copy(args):
if not (args.tospace or args.toname or args.toproject or args.tonamespace):<EOL><INDENT>raise RuntimeError('<STR_LIT>' +<EOL>'<STR_LIT>')<EOL><DEDENT>copy = fapi.get_workspace_config(args.fromproject, args.fromspace,<EOL>args.namespace, args.config)<EOL>fapi._check_response_code(copy, <NUM_LIT:200>)<EOL>copy = copy.json()<EOL>if not args.toname:<EOL><INDENT>args.toname = args.config<EOL><DEDENT>if not args.tonamespace:<EOL><INDENT>args.tonamespace = args.namespace<EOL><DEDENT>if not args.toproject:<EOL><INDENT>args.toproject = args.fromproject<EOL><DEDENT>if not args.tospace:<EOL><INDENT>args.tospace = args.fromspace<EOL><DEDENT>copy['<STR_LIT:name>'] = args.toname<EOL>copy['<STR_LIT>'] = args.tonamespace<EOL>r = fapi.overwrite_workspace_config(args.toproject, args.tospace,<EOL>args.tonamespace, args.toname, copy)<EOL>fapi._check_response_code(r, <NUM_LIT:200>)<EOL>if fcconfig.verbosity:<EOL><INDENT>print("<STR_LIT>" % (<EOL>args.fromproject, args.fromspace, args.config,<EOL>args.toproject, args.tospace, args.toname))<EOL><DEDENT>return <NUM_LIT:0><EOL>
Copy a method config to new name/space/namespace/project (or all 4)