From f7220924bc69d3aa576b2e784cd2399f85236c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 30 Aug 2018 10:33:30 +0200 Subject: [PATCH] Replaced deprecated call to collection.count() --- pillar/cli/maintenance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pillar/cli/maintenance.py b/pillar/cli/maintenance.py index 461b9daa..7e01b19e 100644 --- a/pillar/cli/maintenance.py +++ b/pillar/cli/maintenance.py @@ -684,8 +684,8 @@ def upgrade_attachment_schema(proj_url=None, all_projects=False, go=False): log_proj() log.info('Removed %d empty attachment dicts', res.modified_count) else: - to_remove = nodes_coll.count({'properties.attachments': {}, - 'project': project['_id']}) + to_remove = nodes_coll.count_documents({'properties.attachments': {}, + 'project': project['_id']}) if to_remove: log_proj() log.info('Would remove %d empty attachment dicts', to_remove)