Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Use == for string equality comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
richardTowers committed Aug 29, 2018
1 parent 27b8e07 commit 9910bd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backdrop/core/config/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ def load_paas_settings():
database_engine = os.getenv('DATABASE_ENGINE', 'mongodb')
paas['DATABASE_ENGINE'] = database_engine

if database_engine is 'mongodb' and 'mongodb' in vcap:
if database_engine == 'mongodb' and 'mongodb' in vcap:
for service in vcap['mongodb']:
if service['name'] == 'gds-performance-platform-mongodb-service':
credentials = service['credentials']
paas['DATABASE_URL'] = credentials['uri']
ca_cert = b64decode(credentials['ca_certificate_base64'])
paas['CA_CERTIFICATE'] = ca_cert

if database_engine is 'postgres' and 'postgres' in vcap:
if database_engine == 'postgres' and 'postgres' in vcap:
for service in vcap['postgres']:
if service['name'] == 'backdrop-db':
credentials = service['credentials']
Expand Down
4 changes: 2 additions & 2 deletions backdrop/core/storage/storage_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
def create_storage_engine(config):
database_engine = config['DATABASE_ENGINE']
database_url = config['DATABASE_URL']
if database_engine is 'mongodb':
if database_engine == 'mongodb':
storage = MongoStorageEngine.create(
database_url,
config.get('CA_CERTIFICATE')
)
elif database_engine is 'postgres':
elif database_engine == 'postgres':
storage = PostgresStorageEngine(database_url)
else:
raise NotImplementedError(
Expand Down

0 comments on commit 9910bd3

Please sign in to comment.