зеркало из https://github.com/mozilla/treeherder.git
command to export oauth credentials
This commit is contained in:
Родитель
abd2c37bef
Коммит
ec56c5c511
|
@ -0,0 +1,30 @@
|
|||
import os
|
||||
import json
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from treeherder.model.models import Datasource
|
||||
from treeherder.model.derived.base import TreeherderModelBase
|
||||
from treeherder.etl import buildapi
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Management command to run mozilla pulse consumer."""
|
||||
|
||||
help = (
|
||||
"Exports the objectstore Oauth keys for etl data import tasks"
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
immutable_credentials = TreeherderModelBase.get_oauth_credentials()
|
||||
|
||||
file_path = os.path.join(
|
||||
os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
|
||||
'data',
|
||||
'credentials.json'
|
||||
)
|
||||
|
||||
keys_fh = open(file_path, 'w')
|
||||
keys_fh.write(json.dumps(immutable_credentials))
|
||||
keys_fh.close()
|
Загрузка…
Ссылка в новой задаче