Skip to content

Commit

Permalink
sync-galaxy-collecitons: add options for remote and repo name.
Browse files Browse the repository at this point in the history
No-Issue

Signed-off-by: James Tanner <[email protected]>
  • Loading branch information
jctanner committed Oct 2, 2023
1 parent cecf61a commit 3066cbc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions galaxy_ng/app/management/commands/sync-galaxy-collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def add_arguments(self, parser):
parser.add_argument("--baseurl", default="https://old-galaxy.ansible.com")
parser.add_argument("--namespace", help="find and sync only this namespace name")
parser.add_argument("--name", help="find and sync only this name")
parser.add_argument("--remote", help="name for the remote", default="published")
parser.add_argument("--repository", help="name for the repository", default="published")
parser.add_argument("--rebuild_only", action="store_true", help="only rebuild metadata")
parser.add_argument("--limit", type=int)

Expand All @@ -50,8 +52,12 @@ def echo(self, message, style=None):

def handle(self, *args, **options):

remote = CollectionRemote.objects.filter(name='community').first()
repo = AnsibleRepository.objects.filter(name='published').first()
remote = CollectionRemote.objects.filter(name=options['remote']).first()
if not remote:
raise Exception('could not find remote')
repo = AnsibleRepository.objects.filter(name=options['repository']).first()
if not repo:
raise Exception('could not find repo')

counter = 0
processed_namespaces = set()
Expand Down

0 comments on commit 3066cbc

Please sign in to comment.