Skip to content

deprecation warning for collection_names() method #252

@fuxjezz

Description

@fuxjezz

Hi,

if "last_primary_server" in db.collection_names(): 

on line 1389 throws a deprecation warning:

root@mdnode1:/home# ./check_cluster.py -A replica_primary -r rsmain -W 15 -C 30
./check_cluster.py:1389: DeprecationWarning: collection_names is deprecated. Use list_collection_names instead.
  if "last_primary_server" in db.collection_names():
OK - Primary server has not changed

changing it into :

 if "last_primary_server" in db.list_collection_names():

seems to silence the warning.

Kind regards,

Ruben

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions