Exemple #1
0
    default="rpm",
)
@pass_pulp_context
@click.pass_context
def remote(ctx: click.Context, pulp_ctx: PulpContext,
           remote_type: str) -> None:
    if remote_type == "rpm":
        ctx.obj = PulpRpmRemoteContext(pulp_ctx)
    else:
        raise NotImplementedError()


lookup_options = [href_option, name_option]
rpm_remote_options = [
    click.option("--policy",
                 type=click.Choice(["immediate", "on_demand", "streamed"],
                                   case_sensitive=False)),
    click.option("--sles-auth-token"),
]

remote.add_command(list_command(decorators=[label_select_option]))
remote.add_command(show_command(decorators=lookup_options))
remote.add_command(
    create_command(decorators=common_remote_create_options +
                   rpm_remote_options))
remote.add_command(
    update_command(decorators=lookup_options + common_remote_update_options +
                   rpm_remote_options))
remote.add_command(destroy_command(decorators=lookup_options))
remote.add_command(label_command())
Exemple #2
0
lookup_options = [href_option, name_option]
create_options = [
    click.option("--name", required=True),
    click.option("--base-path", required=True),
    repository_option,
    click.option(
        "--version",
        type=int,
        help=_("a repository version number, leave blank for latest")),
]

distribution.add_command(list_command(decorators=filter_options))
distribution.add_command(show_command(decorators=lookup_options))
distribution.add_command(create_command(decorators=create_options))
distribution.add_command(destroy_command(decorators=lookup_options))
distribution.add_command(label_command())


@distribution.command()
@href_option
@name_option
@click.option("--base-path")
@repository_option
@click.option("--version",
              type=int,
              help=_("a repository version number, leave blank for latest"))
@pass_entity_context
@pass_pulp_context
def update(
    pulp_ctx: PulpContext,
    distribution_ctx: PulpContainerDistributionContext,
Exemple #3
0
        help=_(
            """JSON string with a list of objects to remove from the repository.
    Each object should have the key: "filename"
    The argument prefixed with the '@' can be the path to a JSON file with a list of objects."""
        ),
    ),
]

repository.add_command(list_command(decorators=[label_select_option]))
repository.add_command(show_command(decorators=lookup_options))
repository.add_command(create_command(decorators=create_options))
repository.add_command(update_command(decorators=lookup_options + update_options))
repository.add_command(destroy_command(decorators=lookup_options))
repository.add_command(task_command(decorators=nested_lookup_options))
repository.add_command(version_command(decorators=nested_lookup_options))
repository.add_command(label_command(decorators=nested_lookup_options))
repository.add_command(
    repository_content_command(
        contexts={"package": PulpPythonContentContext},
        add_decorators=[package_option],
        remove_decorators=[package_option],
        modify_decorators=modify_options,
    )
)


@repository.command()
@name_option
@href_option
@remote_option
@pass_repository_context
Exemple #4
0
    click.option("--name", required=True),
    click.option("--description"),
    click.option("--remote", callback=_remote_callback),
]
update_options = [
    click.option("--description"),
    click.option("--remote", callback=_remote_callback),
]

repository.add_command(list_command(decorators=[label_select_option]))
repository.add_command(show_command(decorators=lookup_options))
repository.add_command(create_command(decorators=create_options))
repository.add_command(update_command(decorators=lookup_options + update_options))
repository.add_command(destroy_command(decorators=lookup_options))
repository.add_command(version_command())
repository.add_command(label_command())


@repository.command()
@name_option
@href_option
@click.option("--remote", callback=_remote_callback)
@pass_repository_context
def sync(
    repository_ctx: PulpRepositoryContext,
    remote: Optional[Union[str, PulpEntityContext]],
) -> None:
    repository = repository_ctx.entity
    repository_href = repository_ctx.pulp_href

    body = {}
Exemple #5
0
        required=True,
        callback=_repository_callback,
        help=_("repository with content to distribute"),
    ),
    click.option(
        "--version",
        type=int,
        help=_("a repository version number, leave blank for latest")),
]
distribution.add_command(list_command(decorators=filter_options))
distribution.add_command(show_command(decorators=lookup_options))
distribution.add_command(destroy_command(decorators=lookup_options))
distribution.add_command(create_command(decorators=create_options))
distribution.add_command(
    label_command(need_plugins=[
        PluginRequirement("core", "3.10.0"),
        PluginRequirement("ansible", "0.8.0.dev"),
    ]))


# TODO Add content_guard option
@distribution.command()
@name_option
@href_option
@click.option("--base-path", help=_("new base_path"))
@click.option("--repository",
              type=str,
              default=None,
              help=_("new repository to be served"))
@click.option(
    "--version",
    type=int,
Exemple #6
0
        required=True,
        callback=_repository_callback,
        help=_("repository with content to distribute"),
    ),
    click.option(
        "--version",
        type=int,
        help=_("a repository version number, leave blank for latest")),
]
distribution.add_command(list_command(decorators=filter_options))
distribution.add_command(show_command(decorators=lookup_options))
distribution.add_command(destroy_command(decorators=lookup_options))
distribution.add_command(create_command(decorators=create_options))
distribution.add_command(
    label_command(
        need_plugins=[PRV("core", "3.10.0"),
                      PRV("ansible", "0.8.0.dev")]))


# TODO Add content_guard option
@distribution.command()
@name_option
@href_option
@click.option("--base-path", help=_("new base_path"))
@click.option("--repository",
              type=str,
              default=None,
              help=_("new repository to be served"))
@click.option(
    "--version",
    type=int,