Error: A resource type must be specified with the content_guard option

I’m trying to create a pypi repository which requires credentials to download anything. I followed this guide Protect Content - Pulp Project.
Here is what I did:

pulp python repository create --name private --description "Protected repository"
pulp content-guard rbac create --name rbac
pulp group create --name python-ro
pulp content-guard rbac assign --name rbac --user denis --group python-ro

but when I try to create a distribution I’m getting the error:

pulp python distribution create --name protected-test --base-path private --repository private --content-guard python-ro
Error: A resource type must be specified with the content_guard option.

What I’m doing wrong here?

1 Like

From pulp python distribution create --help:

  --content-guard TEXT            Content Guard used to protect the
                                  distribution. Specified as
                                  '<plugin>:<type>:<name>' or as href.

I think that means you need to tell the cli it’s supposed to be an RBAC content guard. Can you try

--content-guard core:rbac:rbac

(the second “rbac” being the name you gave the content guard)?

Thanks! It works in this way. I’ll try to create a PR for a documentation.

1 Like