Skip to content

Commit

Permalink
allow usage of environment variables as config values
Browse files Browse the repository at this point in the history
  • Loading branch information
oribrost committed Aug 14, 2011
1 parent bcb4442 commit a495865
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions S3/Config.py
Expand Up @@ -6,6 +6,7 @@
import logging
from logging import debug, info, warning, error
import re
import os
import Progress
from SortedDict import SortedDict

Expand Down Expand Up @@ -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":
Expand Down

1 comment on commit a495865

@mludvig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged back to s3tools/s3cmd, thanks!

Please sign in to comment.