Skip to content

Commit

Permalink
Allow to configure the plugin using environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz committed Jul 23, 2018
1 parent d121b68 commit 1b40d8d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ckanext/baepublisher/store_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,15 @@ def __init__(self, config):
if not len(self.store_url):
raise StoreException('A store URL for the baepublisher has not been provided')

self.verify_https = not bool(os.environ.get('OAUTHLIB_INSECURE_TRANSPORT'))
self.verify_https = os.environ.get('OAUTHLIB_INSECURE_TRANSPORT', 'false').strip().lower() in ('', 'false', '0', 'off')

def _get_url(self, config, config_property):
url = config.get(config_property, '')
env_name = config_property.upper().replace('.', '_')
url = os.environ.get(env_name, '').strip()

if url == '':
url = config.get(config_property, '')

url = url[:-1] if url.endswith('/') else url
return url

Expand Down

0 comments on commit 1b40d8d

Please sign in to comment.