usage() if '-h' in opts: usage() try: srcSys = opts['-s'] dstSys = opts['-d'] grpNam = opts['-g'] except KeyError: usage() # create a group itself grp = Groups() try: srcGid = grp.by_name(srcSys, grpNam)['id'] except KeyError: usage("Group with name '%s' doesn't exist in the source system" % grpNam) dstGid = grp.add(dstSys, grpNam)['id'] # add members to the group add_members(grp, srcGid, dstGid) # copy projects with their members from the source group to the destination one prj = Projects() for p in prj.by_namespace(srcSys, srcGid): add_members(prj, p['id'], prj.add(dstSys, p['name'], namespace_id = dstGid, **filter_dict(p, 'description', 'issues_enabled', 'merge_requests_enabled', 'wiki_enabled',