(self, api)
return api['local']['system.replset'].find_one()
On most nodes, simply collects the replset config from the system.replset collection in the local db.
        Unfortunately when the agent is connected to an arbiter, this can't be run without
        raising authentication errors. And because authenticating on an arbiter is not allowed, the workaround
        in that case is to run the command directly on the primary.
On most nodes, simply collects the replset config from the system.replset collection in the local db.
        Unfortunately when the agent is connected to an arbiter, this can't be run without
        raising authentication errors. And because authenticating on an arbiter is not allowed, the workaround
        in that case is to run the command directly on the primary.
On most nodes simply collects the replset config from the system . replset collection in the local db . Unfortunately when the agent is connected to an arbiter this can t be run without raising authentication errors . And because authenticating on an arbiter is not allowed the workaround in that case is to run the command directly on the primary .
def get_votes_config(self, api):
        """On most nodes, simply collects the replset config from the system.replset collection in the local db.
        Unfortunately when the agent is connected to an arbiter, this can't be run without
        raising authentication errors. And because authenticating on an arbiter is not allowed, the workaround
        in that case is to run the command directly on the primary."""

        if api.deployment_type.is_arbiter:
            try:
                api = MongoApi(self.check._config, self.log, replicaset=api.deployment_type.replset_name)
            except Exception:
                self.log.warning(
                    "Current node is an arbiter, the extra connection to the primary was unsuccessful."
                    " Votes metrics won't be reported."
                )
                return None

        return api['local']['system.replset'].find_one()
def get_votes_config ( self , api ) : if api . deployment_type . is_arbiter : try : api = MongoApi ( self . check . _config , self . log , replicaset = api . deployment_type . replset_name ) except Exception : self . log . warning ( "Current node is an arbiter, the extra connection to the primary was unsuccessful." " Votes metrics won't be reported." ) return None return api [ 'local' ] [ 'system.replset' ] . find_one ( )