Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pulp-glue/src/pulp_glue/ansible/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ class PulpAnsibleRoleRemoteContext(PulpRemoteContext):
NEEDS_PLUGINS = [PluginRequirement("ansible", specifier=">=0.7.0")]


class PulpAnsibleGitRemoteContext(PulpRemoteContext):
PLUGIN = "ansible"
RESOURCE_TYPE = "git"
ENTITY = _("git remote")
ENTITIES = _("git remotes")
HREF = "ansible_git_remote_href"
ID_PREFIX = "remotes_ansible_git"
HREF_PATTERN = r"remotes/(?P<plugin>ansible)/(?P<resource_type>git)/"
NEEDS_PLUGINS = [PluginRequirement("ansible", specifier=">=0.7.0")]


class PulpAnsibleCollectionRemoteContext(PulpRemoteContext):
PLUGIN = "ansible"
RESOURCE_TYPE = "collection"
Expand Down
2 changes: 2 additions & 0 deletions src/pulpcore/cli/ansible/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pulp_glue.ansible.context import (
PulpAnsibleCollectionRemoteContext,
PulpAnsibleRoleRemoteContext,
PulpAnsibleGitRemoteContext,
)
from pulp_glue.common.i18n import get_translation

Expand Down Expand Up @@ -46,6 +47,7 @@ def yaml_callback(ctx: click.Context, param: click.Parameter, value: t.Any) -> s
choices={
"collection": PulpAnsibleCollectionRemoteContext,
"role": PulpAnsibleRoleRemoteContext,
"git": PulpAnsibleGitRemoteContext,
}
)
def remote() -> None:
Expand Down
2 changes: 2 additions & 0 deletions src/pulpcore/cli/ansible/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
PulpAnsibleRepositoryContext,
PulpAnsibleRoleContext,
PulpAnsibleRoleRemoteContext,
PulpAnsibleGitRemoteContext,
)
from pulp_glue.common.context import (
EntityFieldDefinition,
Expand Down Expand Up @@ -59,6 +60,7 @@
context_table={
"ansible:collection": PulpAnsibleCollectionRemoteContext,
"ansible:role": PulpAnsibleRoleRemoteContext,
"ansible:git": PulpAnsibleGitRemoteContext,
},
href_pattern=PulpRemoteContext.HREF_PATTERN,
help=_(
Expand Down
Loading