-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No-Issue Signed-off-by: James Tanner <[email protected]>
- Loading branch information
Showing
6 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import django_guid | ||
from django.contrib.auth import get_user_model | ||
from django.core.management.base import BaseCommand | ||
|
||
from galaxy_ng.app.api.v1.tasks import legacy_sync_from_upstream | ||
|
||
|
||
# Set logging_uid, this does not seem to get generated when task called via management command | ||
django_guid.set_guid(django_guid.utils.generate_guid()) | ||
|
||
|
||
class Command(BaseCommand): | ||
""" | ||
Iterates through every upstream namespace and syncs it. | ||
""" | ||
|
||
help = 'Sync upstream namespaces from [old-]galaxy.ansible.com' | ||
|
||
def add_arguments(self, parser): | ||
parser.add_argument("--baseurl", default="https://galaxy.ansible.com") | ||
parser.add_argument("--github_user", help="find and sync only this namespace name") | ||
parser.add_argument("--role_name", help="find and sync only this role name") | ||
parser.add_argument("--limit", type=int) | ||
|
||
def echo(self, message, style=None): | ||
style = style or self.style.SUCCESS | ||
self.stdout.write(style(message)) | ||
|
||
def handle(self, *args, **options): | ||
|
||
legacy_sync_from_upstream( | ||
baseurl=options['baseurl'], | ||
github_user=options['github_user'], | ||
role_name=options['role_name'], | ||
limit=options['limit'], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters