예제 #1
0
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)
예제 #2
0
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}
예제 #3
0
def add(entity_ctx: PulpGroupUserContext, username: str) -> None:
    entity_ctx.create(body={"username": username})
예제 #4
0
def user(ctx: click.Context, pulp_ctx: PulpContext,
         group_ctx: PulpGroupContext) -> None:
    ctx.obj = PulpGroupUserContext(pulp_ctx, group_ctx)