From ae6fbf5383195efc9a83e49e183bdd6b5d0016b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 26 Apr 2019 11:45:50 +0200 Subject: [PATCH] No longer using deprecated db.collection_names() function --- flamenco/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flamenco/__init__.py b/flamenco/__init__.py index 2919ebf2..5dbd5557 100644 --- a/flamenco/__init__.py +++ b/flamenco/__init__.py @@ -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={ @@ -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: