def remove(pulp_ctx: PulpContext, entity_ctx: PulpGroupUserContext, username: str) -> None: user_href = PulpUserContext(pulp_ctx).find(username=username)["pulp_href"] user_pk = user_href.split("/")[-2] group_user_href = entity_ctx.group_ctx.pulp_href + "users/" + user_pk entity_ctx.delete(group_user_href)
def user(ctx: click.Context, pulp_ctx: PulpContext, group_ctx: PulpGroupContext, groupname: str) -> None: ctx.obj = PulpGroupUserContext(pulp_ctx, group_ctx) if groupname is not None: group_ctx.entity = {"name": groupname}
def add(entity_ctx: PulpGroupUserContext, username: str) -> None: entity_ctx.create(body={"username": username})
def user(ctx: click.Context, pulp_ctx: PulpContext, group_ctx: PulpGroupContext) -> None: ctx.obj = PulpGroupUserContext(pulp_ctx, group_ctx)