Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added the ability to add values as environment variables #3

Merged
merged 1 commit into from

2 participants

@oribrost

This is useful when trying to be compatible with an AWS utility which uses environment vavriables.

Usage example:
[default]
access_key = $AWS_AKI
secret_key =
acl_public = False
bucket_location = US

@mludvig mludvig merged commit a495865 into s3tools:master
@mludvig
Owner

Merged back to s3tools/s3cmd, thanks!

@sidkoul sidkoul referenced this pull request in newfs/gobotany-app
Closed

AWS Credentials for s3cmd #261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 14, 2011
  1. @oribrost
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +4 −0 S3/Config.py
View
4 S3/Config.py
@@ -6,6 +6,7 @@
import logging
from logging import debug, info, warning, error
import re
+import os
import Progress
from SortedDict import SortedDict
@@ -116,6 +117,9 @@ def dump_config(self, stream):
def update_option(self, option, value):
if value is None:
return
+ #### Handle environment reference
+ if str(value).startswith("$"):
+ return self.update_option(option, os.getenv(str(value)[1:]))
#### Special treatment of some options
## verbosity must be known to "logging" module
if option == "verbosity":
Something went wrong with that request. Please try again.