[go: nahoru, domu]

Skip to content

Commit

Permalink
using os.env for token
Browse files Browse the repository at this point in the history
  • Loading branch information
6syun9 committed Sep 24, 2019
1 parent ef2fa9e commit ffc8fa6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gokart/gcs_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class GCSConfig(luigi.Config):

def get_gcs_client(self) -> luigi.contrib.gcs.GCSClient:
return luigi.contrib.gcs.GCSClient(
oauth_credentials=os.environ.get(self.gcs_credential_name))
oauth_credentials=os.getenv(self.gcs_credential_name, self.gcs_credential_name))
2 changes: 1 addition & 1 deletion gokart/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _try_to_delete_unnecessary_output_file(cmdline_args: List[str]):
def _try_get_slack_api(cmdline_args: List[str]) -> Optional[gokart.slack.SlackAPI]:
with CmdlineParser.global_instance(cmdline_args):
config = gokart.slack.SlackConfig()
token = config.token_name
token = os.getenv(config.token_name, config.token_name)
channel = config.channel
to_user = config.to_user
if token and channel:
Expand Down
4 changes: 2 additions & 2 deletions gokart/s3_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ class S3Config(luigi.Config):

def get_s3_client(self) -> luigi.contrib.s3.S3Client:
return luigi.contrib.s3.S3Client(
aws_access_key_id=os.environ.get(self.aws_access_key_id_name),
aws_secret_access_key=os.environ.get(self.aws_secret_access_key_name))
aws_access_key_id=os.getenv(self.aws_access_key_id_name, self.aws_access_key_id_name),
aws_secret_access_key=os.getenv(self.aws_secret_access_key_name, self.aws_secret_access_key_name))

0 comments on commit ffc8fa6

Please sign in to comment.