Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
No longer using deprecated db.collection_names() function
Browse files Browse the repository at this point in the history
  • Loading branch information
sybrenstuvel committed Apr 26, 2019
1 parent cd21c4e commit ae6fbf5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flamenco/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ def _create_collections(self, db):
)

# flamenco_tasks
if 'flamenco_tasks' not in db.collection_names(include_system_collections=False):
collection_names = {coll['name'] for coll in db.list_collections()}
if 'flamenco_tasks' not in collection_names:
self._log.info('Creating flamenco_tasks collection.')
db.create_collection('flamenco_tasks',
storageEngine={
Expand All @@ -214,7 +215,7 @@ def _create_collections(self, db):
)

# Manager linking keys
if 'flamenco_manager_linking_keys' not in db.list_collection_names():
if 'flamenco_manager_linking_keys' not in collection_names:
self._log.info('Creating flamenco_manager_linking_keys collection.')
db.create_collection('flamenco_manager_linking_keys')
else:
Expand Down

0 comments on commit ae6fbf5

Please sign in to comment.