Returns the best secondary member to be used for dumping
        best = passives with least lags, if no passives then least lag

def get_dump_best_secondary(self, max_repl_lag=None):
        """
        Returns the best secondary member to be used for dumping
        best = passives with least lags, if no passives then least lag
        """
        secondary_lag_tuples = []

        primary_member = self.get_primary_member()
        if not primary_member:
            raise MongoctlException("Unable to determine primary member for"
                                    " cluster '%s'" % self.id)

        master_status = primary_member.get_server().get_member_rs_status()

        if not master_status:
            raise MongoctlException("Unable to determine replicaset status for"
                                    " primary member '%s'" %
                                    primary_member.get_server().id)

        for member in self.get_members():
            if member.get_server().is_secondary():
                repl_lag = member.get_server().get_repl_lag(master_status)
                if max_repl_lag and  repl_lag > max_repl_lag:
                    log_info("Excluding member '%s' because it's repl lag "
                             "(in seconds)%s is more than max %s. " %
                             (member.get_server().id,
                              repl_lag, max_repl_lag))
                    continue
                secondary_lag_tuples.append((member,repl_lag))

        def best_secondary_comp(x, y):
            x_mem, x_lag = x
            y_mem, y_lag = y
            if x_mem.is_passive():
                if y_mem.is_passive():
                    return x_lag - y_lag
                else:
                    return -1
            elif y_mem.is_passive():
                return 1
            else:
                return x_lag - y_lag

        if secondary_lag_tuples:
            secondary_lag_tuples.sort(best_secondary_comp)
            return secondary_lag_tuples[0][0]