Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gets API key, project ID, and service account JSON from environment #1064

Merged
merged 1 commit into from
Aug 9, 2017
Merged
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
14 changes: 10 additions & 4 deletions iot/api-client/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import argparse
import io
import os
import sys
import time

Expand Down Expand Up @@ -344,16 +345,21 @@ def parse_command_line_args():
formatter_class=argparse.RawDescriptionHelpFormatter)

# Required arguments
parser.add_argument(
'--project_id', required=True, help='GCP cloud project name.')
parser.add_argument(
'--pubsub_topic',
required=True,
help=('Google Cloud Pub/Sub topic. '
'Format is projects/project_id/topics/topic-id'))
parser.add_argument('--api_key', required=True, help='Your API key.')

# Optional arguments
parser.add_argument(
'--api_key',
default=os.environ.get("API_KEY"),
help='Your API key.')
parser.add_argument(
'--project_id',
default=os.environ.get("GOOGLE_CLOUD_PROJECT"),
help='GCP cloud project name.')
parser.add_argument(
'--ec_public_key_file',
default=None,
Expand All @@ -366,7 +372,7 @@ def parse_command_line_args():
'--cloud_region', default='us-central1', help='GCP cloud region')
parser.add_argument(
'--service_account_json',
default='service_account.json',
default=os.environ.get("GOOGLE_APPLICATION_CREDENTIALS"),
help='Path to service account json file.')
parser.add_argument(
'--registry_id',
Expand Down