Skip to content

Commit

Permalink
Safer access to optional parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarczin authored Sep 25, 2017
1 parent ab1d76a commit fe49c4d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions storefact/_store_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ def _create_store_azure(type, params):
from simplekv.net.azurestore import AzureBlockBlobStore
from ._hstores import HAzureBlockBlobStore

if 'connection_string' not in params:
conn_string = _build_azure_url(**params)
else:
conn_string = params['connection_string']
if params['create_if_missing'] and params['use_sas']:
conn_string = params.get('connection_string', _build_azure_url(**params))

if params['create_if_missing'] and params.get('use_sas', False):
raise Exception('create_if_missing is incompatible with the use of SAS tokens.')

if type == 'azure':
Expand Down

0 comments on commit fe49c4d

Please sign in to comment.